diff options
Diffstat (limited to 'evc/src/threading.rs')
-rw-r--r-- | evc/src/threading.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/evc/src/threading.rs b/evc/src/threading.rs index 012b5bf..3291172 100644 --- a/evc/src/threading.rs +++ b/evc/src/threading.rs @@ -5,13 +5,13 @@ use std::{ static THREADS_RUNNING: AtomicUsize = AtomicUsize::new(0); -pub fn both_par<F1, F2, O1, O2>(f1: F1, f2: F2) -> (O1, O2) +pub fn both_par<F1, F2, O1, O2>(f1: F1, f2: F2, max_threads: usize) -> (O1, O2) where F1: FnOnce() -> O1 + Send + 'static, O1: Send + 'static, F2: FnOnce() -> O2, { - if THREADS_RUNNING.load(Ordering::Relaxed) < 12 { + if THREADS_RUNNING.load(Ordering::Relaxed) < max_threads { THREADS_RUNNING.fetch_add(1, Ordering::Relaxed); let o1h = thread::spawn(move || f1()); |