rt: Always delete task stacks on the task thread
There's not a real race here, but it makes helgrind happy and is arguably less prone to future errrors.
This commit is contained in:
parent
9ec94f714a
commit
14306756b4
@ -121,13 +121,6 @@ rust_task::delete_this()
|
||||
I(thread, ref_count == 0); // ||
|
||||
// (ref_count == 1 && this == sched->root_task));
|
||||
|
||||
// Delete all the stacks. There may be more than one if the task failed
|
||||
// and no landing pads stopped to clean up.
|
||||
// FIXME: We should do this when the task exits, not in the destructor
|
||||
while (stk != NULL) {
|
||||
del_stack();
|
||||
}
|
||||
|
||||
thread->release_task(this);
|
||||
}
|
||||
|
||||
@ -725,6 +718,16 @@ rust_task::check_stack_canary() {
|
||||
::check_stack_canary(stk);
|
||||
}
|
||||
|
||||
void
|
||||
rust_task::delete_all_stacks() {
|
||||
I(thread, !on_rust_stack());
|
||||
// Delete all the stacks. There may be more than one if the task failed
|
||||
// and no landing pads stopped to clean up.
|
||||
while (stk != NULL) {
|
||||
del_stack();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rust_task::config_notify(chan_handle chan) {
|
||||
notify_enabled = true;
|
||||
|
@ -205,6 +205,7 @@ public:
|
||||
void reset_stack_limit();
|
||||
bool on_rust_stack();
|
||||
void check_stack_canary();
|
||||
void delete_all_stacks();
|
||||
|
||||
void config_notify(chan_handle chan);
|
||||
|
||||
|
@ -144,6 +144,7 @@ rust_task_thread::reap_dead_tasks() {
|
||||
rust_task *task = dead_tasks_copy[i];
|
||||
// Release the task from the kernel so nobody else can get at it
|
||||
kernel->release_task_id(task->id);
|
||||
task->delete_all_stacks();
|
||||
// Deref the task, which may cause it to request us to release it
|
||||
task->deref();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user