diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-08 17:46:12 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-09 19:00:15 -0800 |
| commit | d39ea4774614f1db3366184f1e6ce30b7614d9ff (patch) | |
| tree | 1eefada3636e780d131d194eac8093c137705195 /src/rt/rust_task.cpp | |
| parent | 1dad32c015b3eecf4e8f5dc4518eec2fd019def2 (diff) | |
| download | rust-d39ea4774614f1db3366184f1e6ce30b7614d9ff.tar.gz rust-d39ea4774614f1db3366184f1e6ce30b7614d9ff.zip | |
rt: Remove rust_task_user struct
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index 398db5976bb..d2ebac63793 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -190,6 +190,8 @@ rust_task::rust_task(rust_task_thread *thread, rust_task_list *state, rust_task *spawner, const char *name, size_t init_stack_sz) : ref_count(1), + id(0), + notify_enabled(false), stk(NULL), runtime_sp(0), sched(thread->sched), @@ -216,12 +218,8 @@ rust_task::rust_task(rust_task_thread *thread, rust_task_list *state, LOGPTR(thread, "new task", (uintptr_t)this); DLOG(thread, task, "sizeof(task) = %d (0x%x)", sizeof *this, sizeof *this); - assert((void*)this == (void*)&user); - - user.notify_enabled = 0; - stk = new_stk(thread, this, init_stack_sz); - user.rust_sp = stk->end; + rust_sp = stk->end; if (supervisor) { supervisor->ref(); } @@ -338,7 +336,7 @@ rust_task::start(spawn_fn spawnee_fn, I(thread, stk->data != NULL); - char *sp = (char *)user.rust_sp; + char *sp = (char *)rust_sp; sp -= sizeof(spawn_args); @@ -614,14 +612,14 @@ rust_port *rust_task::get_port_by_id(rust_port_id id) { void rust_task::notify(bool success) { // FIXME (1078) Do this in rust code - if(user.notify_enabled) { - rust_task *target_task = kernel->get_task_by_id(user.notify_chan.task); + if(notify_enabled) { + rust_task *target_task = kernel->get_task_by_id(notify_chan.task); if (target_task) { rust_port *target_port = - target_task->get_port_by_id(user.notify_chan.port); + target_task->get_port_by_id(notify_chan.port); if(target_port) { task_notification msg; - msg.id = user.id; + msg.id = id; msg.result = !success ? tr_failure : tr_success; target_port->send(&msg); @@ -715,8 +713,8 @@ rust_task::check_stack_canary() { void rust_task::config_notify(chan_handle chan) { - user.notify_enabled = true; - user.notify_chan = chan; + notify_enabled = true; + notify_chan = chan; } // |
