diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-08 14:26:16 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-08 14:28:41 -0800 |
| commit | 68f82de8178ca5f7ed7a3803fdc41f84fc97664b (patch) | |
| tree | edb675d22632be1ce410139b36702de1a1924973 | |
| parent | 2f8b69534435d8dc459e5731d8fb41b22725b37f (diff) | |
| download | rust-68f82de8178ca5f7ed7a3803fdc41f84fc97664b.tar.gz rust-68f82de8178ca5f7ed7a3803fdc41f84fc97664b.zip | |
rt: Remove task_yield builtin
This is just a special case of task_sleep
| -rw-r--r-- | src/lib/task.rs | 3 | ||||
| -rw-r--r-- | src/rt/rust_builtin.cpp | 6 | ||||
| -rw-r--r-- | src/rt/rustrt.def.in | 1 | ||||
| -rw-r--r-- | src/test/run-pass/bind-native.rs | 4 |
4 files changed, 3 insertions, 11 deletions
diff --git a/src/lib/task.rs b/src/lib/task.rs index b8983e97c8b..1b225ceecf1 100644 --- a/src/lib/task.rs +++ b/src/lib/task.rs @@ -53,7 +53,6 @@ export spawn_joinable; native "cdecl" mod rustrt { // these must run on the Rust stack so that they can swap stacks etc: fn task_sleep(time_in_us: uint); - fn task_yield(); } native "c-stack-cdecl" mod rustrt2 = "rustrt" { @@ -149,7 +148,7 @@ Yield control to the task scheduler The scheduler may schedule another task to execute. */ -fn yield() { ret rustrt::task_yield(); } +fn yield() { sleep(1u) } /* Function: join diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index d05682170d2..dd1e6a2c15c 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -171,12 +171,6 @@ task_sleep(size_t time_in_us) { task->yield(time_in_us); } -extern "C" CDECL void -task_yield() { - rust_task *task = rust_scheduler::get_task(); - task->yield(1); -} - /* Debug builtins for std::dbg. */ static void diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 192774d350f..d75a6dc00f1 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -60,7 +60,6 @@ start_task vec_reserve_shared vec_from_buf_shared task_sleep -task_yield unsupervise upcall_alloc_c_stack upcall_call_c_stack diff --git a/src/test/run-pass/bind-native.rs b/src/test/run-pass/bind-native.rs index 4ddabe857bb..f67fb96c4d4 100644 --- a/src/test/run-pass/bind-native.rs +++ b/src/test/run-pass/bind-native.rs @@ -3,7 +3,7 @@ Can we bind native things? */ native "c-stack-cdecl" mod rustrt { - fn task_yield(); + fn task_sleep(); } -fn main() { bind rustrt::task_yield(); } +fn main() { bind rustrt::task_sleep(); } |
