summary refs log tree commit diff
path: root/src/libstd/sync/rwlock.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-02-18 23:50:21 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-02-18 23:50:21 +1100
commitdfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5 (patch)
treee9c32f2e58b3462a23dd9c472d2f236640b78811 /src/libstd/sync/rwlock.rs
parent6c065fc8cb036785f61ff03e05c1563cbb2dd081 (diff)
parent47f91a9484eceef10536d4caac6ef578cd254567 (diff)
downloadrust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.tar.gz
rust-dfc5c0f1e8799f47f9033bdcc8a7cd8a217620a5.zip
Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton
 One windows bot failed spuriously.
Diffstat (limited to 'src/libstd/sync/rwlock.rs')
-rw-r--r--src/libstd/sync/rwlock.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index c4f1f2ccadd..b8d157d341e 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -400,7 +400,7 @@ mod tests {
 
     use rand::{self, Rng};
     use sync::mpsc::channel;
-    use thread::Thread;
+    use thread;
     use sync::{Arc, RwLock, StaticRwLock, RW_LOCK_INIT};
 
     #[test]
@@ -425,13 +425,13 @@ mod tests {
     #[test]
     fn frob() {
         static R: StaticRwLock = RW_LOCK_INIT;
-        static N: uint = 10;
-        static M: uint = 1000;
+        static N: usize = 10;
+        static M: usize = 1000;
 
         let (tx, rx) = channel::<()>();
         for _ in 0..N {
             let tx = tx.clone();
-            Thread::spawn(move|| {
+            thread::spawn(move|| {
                 let mut rng = rand::thread_rng();
                 for _ in 0..M {
                     if rng.gen_weighted_bool(N) {
@@ -452,7 +452,7 @@ mod tests {
     fn test_rw_arc_poison_wr() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::scoped(move|| {
+        let _: Result<(), _> = thread::spawn(move|| {
             let _lock = arc2.write().unwrap();
             panic!();
         }).join();
@@ -464,7 +464,7 @@ mod tests {
         let arc = Arc::new(RwLock::new(1));
         assert!(!arc.is_poisoned());
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::scoped(move|| {
+        let _: Result<(), _> = thread::spawn(move|| {
             let _lock = arc2.write().unwrap();
             panic!();
         }).join();
@@ -476,7 +476,7 @@ mod tests {
     fn test_rw_arc_no_poison_rr() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::scoped(move|| {
+        let _: Result<(), _> = thread::spawn(move|| {
             let _lock = arc2.read().unwrap();
             panic!();
         }).join();
@@ -487,7 +487,7 @@ mod tests {
     fn test_rw_arc_no_poison_rw() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::scoped(move|| {
+        let _: Result<(), _> = thread::spawn(move|| {
             let _lock = arc2.read().unwrap();
             panic!()
         }).join();
@@ -501,12 +501,12 @@ mod tests {
         let arc2 = arc.clone();
         let (tx, rx) = channel();
 
-        Thread::spawn(move|| {
+        thread::spawn(move|| {
             let mut lock = arc2.write().unwrap();
             for _ in 0u..10 {
                 let tmp = *lock;
                 *lock = -1;
-                Thread::yield_now();
+                thread::yield_now();
                 *lock = tmp + 1;
             }
             tx.send(()).unwrap();
@@ -516,7 +516,7 @@ mod tests {
         let mut children = Vec::new();
         for _ in 0u..5 {
             let arc3 = arc.clone();
-            children.push(Thread::scoped(move|| {
+            children.push(thread::spawn(move|| {
                 let lock = arc3.read().unwrap();
                 assert!(*lock >= 0);
             }));
@@ -537,7 +537,7 @@ mod tests {
     fn test_rw_arc_access_in_unwind() {
         let arc = Arc::new(RwLock::new(1));
         let arc2 = arc.clone();
-        let _ = Thread::scoped(move|| -> () {
+        let _ = thread::spawn(move|| -> () {
             struct Unwinder {
                 i: Arc<RwLock<int>>,
             }