rt: Clean up the way the kernel tracks tasks

This commit is contained in:
Brian Anderson
2012-02-03 17:26:54 -08:00
parent e7f00b6493
commit 12fa90888e
6 changed files with 49 additions and 42 deletions

View File

@@ -275,12 +275,11 @@ rust_task::~rust_task()
DLOG(thread, task, "~rust_task %s @0x%" PRIxPTR ", refcnt=%d",
name, (uintptr_t)this, ref_count);
// FIXME: We should do this when the task exits, not in the destructor
if (supervisor) {
supervisor->deref();
}
kernel->release_task_id(user.id);
/* FIXME: tighten this up, there are some more
assertions that hold at task-lifecycle events. */
I(thread, ref_count == 0); // ||
@@ -288,6 +287,7 @@ rust_task::~rust_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_stk(this, stk);
}