mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-27 18:24:43 +10:00
Update on GameDownload
This commit is contained in:
@@ -5,17 +5,17 @@ use rayon::ThreadPoolBuilder;
|
||||
pub struct ProgressChecker<T>
|
||||
where T: 'static + Send + Sync
|
||||
{
|
||||
counter: AtomicUsize,
|
||||
counter: Arc<AtomicUsize>,
|
||||
f: Arc<Box<dyn Fn(T) + Send + Sync + 'static>>,
|
||||
}
|
||||
|
||||
impl<T> ProgressChecker<T>
|
||||
where T: Send + Sync
|
||||
{
|
||||
pub fn new(f: Box<dyn Fn(T) + Send + Sync + 'static>) -> Self {
|
||||
pub fn new(f: Box<dyn Fn(T) + Send + Sync + 'static>, counter_reference: Arc<AtomicUsize>) -> Self {
|
||||
Self {
|
||||
f: f.into(),
|
||||
counter: AtomicUsize::new(0)
|
||||
counter: counter_reference
|
||||
}
|
||||
}
|
||||
pub async fn run_contexts_sequentially_async(&self, contexts: Vec<T>) {
|
||||
|
||||
Reference in New Issue
Block a user