rt: Remove task_yield builtin

This is just a special case of task_sleep
This commit is contained in:
Brian Anderson 2011-11-08 14:26:16 -08:00
parent 2f8b695344
commit 68f82de817
4 changed files with 3 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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(); }