wait-for-sync-obj: clear tasks on shutdown
This commit is contained in:
parent
0f2d63ef44
commit
90b945b780
2 changed files with 7 additions and 7 deletions
|
|
@ -1073,6 +1073,7 @@ impl State {
|
|||
self.cursor_user_groups.clear();
|
||||
self.cursor_user_group_hardware_cursor.take();
|
||||
self.cpu_worker.clear();
|
||||
self.wait_for_sync_obj.clear();
|
||||
}
|
||||
|
||||
pub fn remove_toplevel_id(&self, id: ToplevelIdentifier) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,12 @@ impl WaitForSyncObj {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.inner.ctx.take();
|
||||
self.inner.busy.clear();
|
||||
self.inner.idle.take();
|
||||
}
|
||||
|
||||
pub fn set_ctx(&self, ctx: Option<Rc<SyncObjCtx>>) {
|
||||
self.inner.ctx.set(ctx);
|
||||
let busy_waiters: Vec<_> = self.inner.busy.lock().drain_values().collect();
|
||||
|
|
@ -163,13 +169,6 @@ impl WaitForSyncObj {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for WaitForSyncObj {
|
||||
fn drop(&mut self) {
|
||||
self.inner.busy.clear();
|
||||
self.inner.idle.take();
|
||||
}
|
||||
}
|
||||
|
||||
impl WaiterInner {
|
||||
async fn run(self: Rc<Self>) {
|
||||
let mut buf = Buf::new(8);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue