Skip to content

Commit 7d95dd4

Browse files
stlankesmkroening
authored andcommitted
fix(scheduler): drop the global TASKS entry on exit
The global TASKS BTreeMap got a new TaskHandle on every spawn but was never cleaned up. This made join()'s TASKS.contains_key(&id) always return true for any tid that ever existed, and slowly leaked TaskHandles. exit() already removes the WAITING_TASKS queue — remove the TASKS entry symmetrically.
1 parent a1f61b1 commit 7d95dd4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/scheduler/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ impl PerCoreSchedulerExt for &mut PerCoreScheduler {
194194
self.custom_wakeup(task);
195195
}
196196
}
197+
198+
TASKS.lock().remove(&current_id);
197199
});
198200

199201
self.reschedule();

0 commit comments

Comments
 (0)