task: clear LocalSet's remote queue on drop

Fixes #1885

Signed-off-by: Eliza Weisman <[email protected]>
This commit is contained in:
Eliza Weisman
2019-12-03 11:02:32 -08:00
parent abd28ac3a9
commit 4f46ac6637
+9
View File
@@ -481,6 +481,15 @@ impl fmt::Debug for Scheduler {
impl Drop for Scheduler {
fn drop(&mut self) {
// Close the remote queue
let mut lock = self.remote_queue.lock().unwrap();
while let Some(task) = lock.pop_front() {
task.shutdown();
}
drop(lock);
// Drain all local tasks
while let Some(task) = self.next_local_task() {
task.shutdown();