about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/lib/task.rs3
-rw-r--r--src/rt/rust_builtin.cpp6
-rw-r--r--src/rt/rustrt.def.in1
-rw-r--r--src/test/run-pass/bind-native.rs4
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(); }