rt: Remove rust_task_user struct

This commit is contained in:
Brian Anderson
2012-02-08 17:46:12 -08:00
parent 1dad32c015
commit d39ea47746
5 changed files with 25 additions and 36 deletions

View File

@@ -137,7 +137,7 @@ rust_task_thread::reap_dead_tasks() {
for (size_t i = 0; i < dead_tasks_len; ++i) {
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->user.id);
kernel->release_task_id(task->id);
// Deref the task, which may cause it to request us to release it
task->deref();
}
@@ -151,7 +151,7 @@ rust_task_thread::release_task(rust_task *task) {
// Nobody should have a ref to the task at this point
I(this, task->ref_count == 0);
// Kernel should not know about the task any more
I(this, kernel->get_task_by_id(task->user.id) == NULL);
I(this, kernel->get_task_by_id(task->id) == NULL);
// Now delete the task, which will require using this thread's
// memory region.
delete task;
@@ -249,11 +249,9 @@ rust_task_thread::start_main_loop() {
DLOG(this, task,
"activating task %s 0x%" PRIxPTR
", sp=0x%" PRIxPTR
", state: %s",
scheduled_task->name,
(uintptr_t)scheduled_task,
scheduled_task->user.rust_sp,
scheduled_task->state->name);
place_task_in_tls(scheduled_task);
@@ -265,11 +263,10 @@ rust_task_thread::start_main_loop() {
DLOG(this, task,
"returned from task %s @0x%" PRIxPTR
" in state '%s', sp=0x%x, worker id=%d" PRIxPTR,
" in state '%s', worker id=%d" PRIxPTR,
scheduled_task->name,
(uintptr_t)scheduled_task,
scheduled_task->state->name,
scheduled_task->user.rust_sp,
id);
reap_dead_tasks();
@@ -305,7 +302,7 @@ rust_task_thread::create_task(rust_task *spawner, const char *name,
}
kernel->register_task(task);
return task->user.id;
return task->id;
}
void rust_task_thread::run() {