diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-08-17 14:42:28 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-17 14:42:40 -0700 |
| commit | ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa (patch) | |
| tree | 1a28bb09eaeaf105bd84cc62c6a3e6c9ae2a8b8f /src/rt/rust_task.cpp | |
| parent | efac7c9a197fa3ff3497ce99a2dda8693b3ef683 (diff) | |
| download | rust-ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa.tar.gz rust-ae89ea223de2fe5e9c9a5cdd2fa85a93828a7daa.zip | |
Making more of the rust_task structure directly accessible from Rust.
Diffstat (limited to 'src/rt/rust_task.cpp')
| -rw-r--r-- | src/rt/rust_task.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index b8269554237..7b8160f3637 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -57,7 +57,6 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state, ref_count(1), stk(NULL), runtime_sp(0), - rust_sp(0), gc_alloc_chain(0), sched(sched), cache(NULL), @@ -86,7 +85,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state, user.notify_enabled = 0; stk = new_stk(sched, this, 0); - rust_sp = stk->limit; + user.rust_sp = stk->limit; } rust_task::~rust_task() @@ -99,7 +98,7 @@ rust_task::~rust_task() get_chan_by_handle(&user.notify_chan); if(target) { task_notification msg; - msg.id = id; + msg.id = user.id; msg.result = failed ? tr_failure : tr_success; target->send(&msg); @@ -107,7 +106,7 @@ rust_task::~rust_task() } } - kernel->release_task_id(id); + kernel->release_task_id(user.id); /* FIXME: tighten this up, there are some more assertions that hold at task-lifecycle events. */ @@ -166,7 +165,7 @@ rust_task::start(uintptr_t spawnee_fn, I(sched, stk->data != NULL); - char *sp = (char *)rust_sp; + char *sp = (char *)user.rust_sp; sp -= sizeof(spawn_args); @@ -178,7 +177,7 @@ rust_task::start(uintptr_t spawnee_fn, void **f = (void **)&a->f; *f = (void *)spawnee_fn; - ctx.call((void *)task_start_wrapper, a, sp); + user.ctx.call((void *)task_start_wrapper, a, sp); this->start(); } @@ -213,7 +212,7 @@ rust_task::yield(size_t time_in_us) { yield_timer.reset_us(time_in_us); // Return to the scheduler. - ctx.next->swap(ctx); + user.ctx.next->swap(user.ctx); } void |
