diff --git a/src/praetor/mod.rs b/src/praetor/mod.rs index fb59fe7..5e74683 100644 --- a/src/praetor/mod.rs +++ b/src/praetor/mod.rs @@ -960,15 +960,6 @@ thread_local! { static SCOPE: UnsafeCell>> = const { UnsafeCell::new(None) }; } -impl Drop for Scope { - fn drop(&mut self) { - self.complete_jobs(); - unsafe { - self.job_counter.wait(); - } - } -} - impl Scope { /// locks shared context #[allow(dead_code)] @@ -1087,6 +1078,10 @@ impl Scope { } self.execute(job); } + + unsafe { + self.job_counter.wait(); + } } pub fn spawn<'a, F>(&self, f: F)