This commit is contained in:
Janis 2025-02-22 11:58:21 +01:00
parent 44acdd7873
commit b069f0cc87

View file

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