about summary refs log tree commit diff
path: root/src/libextra
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/libextra
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/libextra')
-rw-r--r--src/libextra/arc.rs8
-rw-r--r--src/libextra/sync.rs20
2 files changed, 14 insertions, 14 deletions
diff --git a/src/libextra/arc.rs b/src/libextra/arc.rs
index 5f00f1abae0..1704e9a48d6 100644
--- a/src/libextra/arc.rs
+++ b/src/libextra/arc.rs
@@ -762,7 +762,7 @@ mod tests {
                 do 10.times {
                     let tmp = *num;
                     *num = -1;
-                    task::yield();
+                    task::deschedule();
                     *num = tmp + 1;
                 }
                 c.send(());
@@ -913,7 +913,7 @@ mod tests {
             do read_mode.read |state| {
                 // if writer mistakenly got in, make sure it mutates state
                 // before we assert on it
-                do 5.times { task::yield(); }
+                do 5.times { task::deschedule(); }
                 // make sure writer didn't get in.
                 assert!(*state);
             }
@@ -921,9 +921,9 @@ mod tests {
     }
     #[test]
     fn test_rw_write_cond_downgrade_read_race() {
-        // Ideally the above test case would have yield statements in it that
+        // Ideally the above test case would have deschedule statements in it that
         // helped to expose the race nearly 100% of the time... but adding
-        // yields in the intuitively-right locations made it even less likely,
+        // deschedules in the intuitively-right locations made it even less likely,
         // and I wasn't sure why :( . This is a mediocre "next best" option.
         do 8.times { test_rw_write_cond_downgrade_read_race_helper() }
     }
diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs
index 756a5c7da00..d32b7d6af03 100644
--- a/src/libextra/sync.rs
+++ b/src/libextra/sync.rs
@@ -112,7 +112,7 @@ impl<Q:Send> Sem<Q> {
                 }
             }
             // Uncomment if you wish to test for sem races. Not valgrind-friendly.
-            /* do 1000.times { task::yield(); } */
+            /* do 1000.times { task::deschedule(); } */
             // Need to wait outside the exclusive.
             if waiter_nobe.is_some() {
                 let _ = waiter_nobe.unwrap().recv();
@@ -225,7 +225,7 @@ impl<'self> Condvar<'self> {
                 }
             }
 
-            // If yield checks start getting inserted anywhere, we can be
+            // If deschedule checks start getting inserted anywhere, we can be
             // killed before or after enqueueing. Deciding whether to
             // unkillably reacquire the lock needs to happen atomically
             // wrt enqueuing.
@@ -731,11 +731,11 @@ mod tests {
         let s2 = ~s.clone();
         do task::spawn || {
             do s2.access {
-                do 5.times { task::yield(); }
+                do 5.times { task::deschedule(); }
             }
         }
         do s.access {
-            do 5.times { task::yield(); }
+            do 5.times { task::deschedule(); }
         }
     }
     #[test]
@@ -748,7 +748,7 @@ mod tests {
             s2.acquire();
             c.send(());
         }
-        do 5.times { task::yield(); }
+        do 5.times { task::deschedule(); }
         s.release();
         let _ = p.recv();
 
@@ -757,7 +757,7 @@ mod tests {
         let s = ~Semaphore::new(0);
         let s2 = ~s.clone();
         do task::spawn || {
-            do 5.times { task::yield(); }
+            do 5.times { task::deschedule(); }
             s2.release();
             let _ = p.recv();
         }
@@ -800,7 +800,7 @@ mod tests {
                     c.send(());
                 }
                 let _ = p.recv(); // wait for child to come alive
-                do 5.times { task::yield(); } // let the child contend
+                do 5.times { task::deschedule(); } // let the child contend
             }
             let _ = p.recv(); // wait for child to be done
         }
@@ -837,7 +837,7 @@ mod tests {
             do n.times {
                 do m.lock {
                     let oldval = *sharedstate;
-                    task::yield();
+                    task::deschedule();
                     *sharedstate = oldval + 1;
                 }
             }
@@ -948,7 +948,7 @@ mod tests {
             let (p,c) = comm::stream();
             do task::spawn || { // linked
                 let _ = p.recv(); // wait for sibling to get in the mutex
-                task::yield();
+                task::deschedule();
                 fail!();
             }
             do m2.lock_cond |cond| {
@@ -1114,7 +1114,7 @@ mod tests {
             do n.times {
                 do lock_rwlock_in_mode(x, mode) {
                     let oldval = *sharedstate;
-                    task::yield();
+                    task::deschedule();
                     *sharedstate = oldval + 1;
                 }
             }