about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-18 15:02:04 -0700
committerbors <bors@rust-lang.org>2013-08-18 15:02:04 -0700
commitb26e11db862a9f06556d2871b1b71e09f652e395 (patch)
treef2515c8e289133c917b0dfd1d0d2f5e4ba7e3281 /src/libstd/task
parente185b049af214cc7900beaae557a12863f4b3ce3 (diff)
parent418e1ebae6ed543b1a78c3e987d42bf0bf25f310 (diff)
downloadrust-b26e11db862a9f06556d2871b1b71e09f652e395.tar.gz
rust-b26e11db862a9f06556d2871b1b71e09f652e395.zip
auto merge of #8560 : kballard/rust/reserve-yield, r=pcwalton
Rename task::yield() to task::deschedule().

Fixes #8494.
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs
index 820baec6a79..2c79f1c4ded 100644
--- a/src/libstd/task/mod.rs
+++ b/src/libstd/task/mod.rs
@@ -537,7 +537,7 @@ pub fn with_task_name<U>(blk: &fn(Option<&str>) -> U) -> U {
     }
 }
 
-pub fn yield() {
+pub fn deschedule() {
     //! Yield control to the task scheduler
 
     use rt::local::Local;
@@ -568,10 +568,10 @@ pub fn failing() -> bool {
  *
  * ~~~
  * do task::unkillable {
- *     // detach / yield / destroy must all be called together
+ *     // detach / deschedule / destroy must all be called together
  *     rustrt::rust_port_detach(po);
  *     // This must not result in the current task being killed
- *     task::yield();
+ *     task::deschedule();
  *     rustrt::rust_port_destroy(po);
  * }
  * ~~~
@@ -689,7 +689,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port
             let ch = ch.clone();
             do spawn_unlinked {
                 // Give middle task a chance to fail-but-not-kill-us.
-                do 16.times { task::yield(); }
+                do 16.times { task::deschedule(); }
                 ch.send(()); // If killed first, grandparent hangs.
             }
             fail!(); // Shouldn't kill either (grand)parent or (grand)child.
@@ -712,7 +712,7 @@ fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails
     do run_in_newsched_task {
         do spawn_supervised { fail!(); }
         // Give child a chance to fail-but-not-kill-us.
-        do 16.times { task::yield(); }
+        do 16.times { task::deschedule(); }
     }
 }
 #[ignore(reason = "linked failure")]
@@ -821,7 +821,7 @@ fn test_spawn_failure_propagate_grandchild() {
             do spawn_supervised {
                 do spawn_supervised { block_forever(); }
             }
-            do 16.times { task::yield(); }
+            do 16.times { task::deschedule(); }
             fail!();
         };
         assert!(result.is_err());
@@ -838,7 +838,7 @@ fn test_spawn_failure_propagate_secondborn() {
             do spawn_supervised {
                 do spawn { block_forever(); } // linked
             }
-            do 16.times { task::yield(); }
+            do 16.times { task::deschedule(); }
             fail!();
         };
         assert!(result.is_err());
@@ -855,7 +855,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() {
             do spawn { // linked
                 do spawn_supervised { block_forever(); }
             }
-            do 16.times { task::yield(); }
+            do 16.times { task::deschedule(); }
             fail!();
         };
         assert!(result.is_err());
@@ -872,7 +872,7 @@ fn test_spawn_linked_sup_propagate_sibling() {
             do spawn { // linked
                 do spawn { block_forever(); } // linked
             }
-            do 16.times { task::yield(); }
+            do 16.times { task::deschedule(); }
             fail!();
         };
         assert!(result.is_err());
@@ -1169,12 +1169,12 @@ fn test_unkillable() {
 
     // We want to do this after failing
     do spawn_unlinked {
-        do 10.times { yield() }
+        do 10.times { deschedule() }
         ch.send(());
     }
 
     do spawn {
-        yield();
+        deschedule();
         // We want to fail after the unkillable task
         // blocks on recv
         fail!();
@@ -1205,12 +1205,12 @@ fn test_unkillable_nested() {
 
     // We want to do this after failing
     do spawn_unlinked || {
-        do 10.times { yield() }
+        do 10.times { deschedule() }
         ch.send(());
     }
 
     do spawn {
-        yield();
+        deschedule();
         // We want to fail after the unkillable task
         // blocks on recv
         fail!();
@@ -1277,7 +1277,7 @@ fn test_spawn_watched() {
                 t.unlinked();
                 t.watched();
                 do t.spawn {
-                    task::yield();
+                    task::deschedule();
                     fail!();
                 }
             }
@@ -1313,7 +1313,7 @@ fn test_indestructible() {
                 t.unwatched();
                 do t.spawn {
                     p3.recv();
-                    task::yield();
+                    task::deschedule();
                     fail!();
                 }
                 c3.send(());