rt: Add a field to rust_task to hold its scheduler

This commit is contained in:
Brian Anderson
2012-02-03 15:18:58 -08:00
parent 8d881967a2
commit 3d0e7a7af3
3 changed files with 3 additions and 2 deletions

View File

@@ -417,7 +417,7 @@ start_task(rust_task_id id, fn_env_pair *f) {
extern "C" CDECL int extern "C" CDECL int
sched_threads() { sched_threads() {
rust_task *task = rust_task_thread::get_task(); rust_task *task = rust_task_thread::get_task();
return task->thread->sched->number_of_threads(); return task->sched->number_of_threads();
} }
extern "C" CDECL rust_port* extern "C" CDECL rust_port*

View File

@@ -233,6 +233,7 @@ rust_task::rust_task(rust_task_thread *thread, rust_task_list *state,
ref_count(1), ref_count(1),
stk(NULL), stk(NULL),
runtime_sp(0), runtime_sp(0),
sched(thread->sched),
thread(thread), thread(thread),
cache(NULL), cache(NULL),
kernel(thread->kernel), kernel(thread->kernel),

View File

@@ -72,10 +72,10 @@ rust_task : public kernel_owned<rust_task>, rust_cond
RUST_ATOMIC_REFCOUNT(); RUST_ATOMIC_REFCOUNT();
// Fields known to the compiler.
context ctx; context ctx;
stk_seg *stk; stk_seg *stk;
uintptr_t runtime_sp; // Runtime sp while task running. uintptr_t runtime_sp; // Runtime sp while task running.
rust_scheduler *sched;
rust_task_thread *thread; rust_task_thread *thread;
rust_crate_cache *cache; rust_crate_cache *cache;