diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-17 15:19:46 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-18 10:32:27 -0800 |
| commit | 21865ddce662767ff8319732cb55b4cdbc9ea67e (patch) | |
| tree | 851f95801560eb107217b3057f8f2f0f4ffb8fd9 /src/lib | |
| parent | eecbc815ac44be2d17338d6dfd60c1417ba29ff1 (diff) | |
intrinsics: Remove the call to get_task from task_sleep
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/task.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/task.rs b/src/lib/task.rs index d5cda975a3a..1d7f859bfa2 100644 --- a/src/lib/task.rs +++ b/src/lib/task.rs @@ -53,7 +53,7 @@ export spawn_joinable; #[abi = "rust-intrinsic"] native mod rusti { // these must run on the Rust stack so that they can swap stacks etc: - fn task_sleep(time_in_us: uint); + fn task_sleep(task: *rust_task, time_in_us: uint); } #[link_name = "rustrt"] @@ -63,6 +63,7 @@ native mod rustrt { fn pin_task(); fn unpin_task(); fn get_task_id() -> task_id; + fn rust_get_task() -> *rust_task; fn set_min_stack(stack_size: uint); @@ -142,7 +143,10 @@ Parameters: time_in_us - maximum number of microseconds to yield control for */ -fn sleep(time_in_us: uint) { ret rusti::task_sleep(time_in_us); } +fn sleep(time_in_us: uint) { + let task = rustrt::rust_get_task(); + ret rusti::task_sleep(task, time_in_us); +} /* Function: yield |
