]> git.proxmox.com Git - proxmox-backup.git/commitdiff
WorkerTaskContext: make it Send + Sync
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 27 Sep 2021 06:39:44 +0000 (08:39 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 27 Sep 2021 07:11:38 +0000 (09:11 +0200)
pbs-tools/src/task.rs
src/backup/verify.rs

index 9e5d5b8fb9c075ce3c713bf0444674c7ed4ae857..a0d755aa394d519b500e502aa393b338e38926b4 100644 (file)
@@ -3,7 +3,7 @@ use anyhow::{bail, Error};
 /// Worker task abstraction
 ///
 /// A worker task is a long running task, which usually logs output into a separate file.
-pub trait WorkerTaskContext {
+pub trait WorkerTaskContext: Send + Sync {
 
     /// Test if there was a request to abort the task.
     fn abort_requested(&self) -> bool;
index cdc48ed2d2ba3aea6d8fd85a4d3cba27ff25fcd9..17179c13a424240b73ab1d0cbdfeea58cf5cb0de 100644 (file)
@@ -19,7 +19,7 @@ use crate::tools::ParallelHandler;
 /// A VerifyWorker encapsulates a task worker, datastore and information about which chunks have
 /// already been verified or detected as corrupt.
 pub struct VerifyWorker {
-    worker: Arc<dyn WorkerTaskContext + Send + Sync>,
+    worker: Arc<dyn WorkerTaskContext>,
     datastore: Arc<DataStore>,
     verified_chunks: Arc<Mutex<HashSet<[u8; 32]>>>,
     corrupt_chunks: Arc<Mutex<HashSet<[u8; 32]>>>,
@@ -27,7 +27,7 @@ pub struct VerifyWorker {
 
 impl VerifyWorker {
     /// Creates a new VerifyWorker for a given task worker and datastore.
-    pub fn new(worker: Arc<dyn WorkerTaskContext + Send + Sync>, datastore: Arc<DataStore>) -> Self {
+    pub fn new(worker: Arc<dyn WorkerTaskContext>, datastore: Arc<DataStore>) -> Self {
         Self {
             worker,
             datastore,