aaaa
This commit is contained in:
parent
44acdd7873
commit
b069f0cc87
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue