rt: Remove task_yield builtin
This is just a special case of task_sleep
This commit is contained in:
parent
2f8b695344
commit
68f82de817
|
@ -53,7 +53,6 @@ export spawn_joinable;
|
||||||
native "cdecl" mod rustrt {
|
native "cdecl" mod rustrt {
|
||||||
// these must run on the Rust stack so that they can swap stacks etc:
|
// these must run on the Rust stack so that they can swap stacks etc:
|
||||||
fn task_sleep(time_in_us: uint);
|
fn task_sleep(time_in_us: uint);
|
||||||
fn task_yield();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
native "c-stack-cdecl" mod rustrt2 = "rustrt" {
|
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.
|
The scheduler may schedule another task to execute.
|
||||||
*/
|
*/
|
||||||
fn yield() { ret rustrt::task_yield(); }
|
fn yield() { sleep(1u) }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: join
|
Function: join
|
||||||
|
|
|
@ -171,12 +171,6 @@ task_sleep(size_t time_in_us) {
|
||||||
task->yield(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. */
|
/* Debug builtins for std::dbg. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -60,7 +60,6 @@ start_task
|
||||||
vec_reserve_shared
|
vec_reserve_shared
|
||||||
vec_from_buf_shared
|
vec_from_buf_shared
|
||||||
task_sleep
|
task_sleep
|
||||||
task_yield
|
|
||||||
unsupervise
|
unsupervise
|
||||||
upcall_alloc_c_stack
|
upcall_alloc_c_stack
|
||||||
upcall_call_c_stack
|
upcall_call_c_stack
|
||||||
|
|
|
@ -3,7 +3,7 @@ Can we bind native things?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
native "c-stack-cdecl" mod rustrt {
|
native "c-stack-cdecl" mod rustrt {
|
||||||
fn task_yield();
|
fn task_sleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { bind rustrt::task_yield(); }
|
fn main() { bind rustrt::task_sleep(); }
|
||||||
|
|
Loading…
Reference in New Issue