about summary refs log tree commit diff
path: root/src/libstd/sync/rwlock.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sync/rwlock.rs')
-rw-r--r--src/libstd/sync/rwlock.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index 36f9d4228b3..7db2111cc46 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -411,7 +411,7 @@ mod tests {
                     }
                 }
                 drop(tx);
-            }).detach();
+            });
         }
         drop(tx);
         let _ = rx.recv();
@@ -422,7 +422,7 @@ mod tests {
     fn test_rw_arc_poison_wr() {
         let arc = Arc::new(RwLock::new(1i));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::spawn(move|| {
+        let _: Result<uint, _> = Thread::scoped(move|| {
             let _lock = arc2.write().unwrap();
             panic!();
         }).join();
@@ -433,7 +433,7 @@ mod tests {
     fn test_rw_arc_poison_ww() {
         let arc = Arc::new(RwLock::new(1i));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::spawn(move|| {
+        let _: Result<uint, _> = Thread::scoped(move|| {
             let _lock = arc2.write().unwrap();
             panic!();
         }).join();
@@ -444,7 +444,7 @@ mod tests {
     fn test_rw_arc_no_poison_rr() {
         let arc = Arc::new(RwLock::new(1i));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::spawn(move|| {
+        let _: Result<uint, _> = Thread::scoped(move|| {
             let _lock = arc2.read().unwrap();
             panic!();
         }).join();
@@ -455,7 +455,7 @@ mod tests {
     fn test_rw_arc_no_poison_rw() {
         let arc = Arc::new(RwLock::new(1i));
         let arc2 = arc.clone();
-        let _: Result<uint, _> = Thread::spawn(move|| {
+        let _: Result<uint, _> = Thread::scoped(move|| {
             let _lock = arc2.read().unwrap();
             panic!()
         }).join();
@@ -478,13 +478,13 @@ mod tests {
                 *lock = tmp + 1;
             }
             tx.send(()).unwrap();
-        }).detach();
+        });
 
         // Readers try to catch the writer in the act
         let mut children = Vec::new();
         for _ in range(0u, 5) {
             let arc3 = arc.clone();
-            children.push(Thread::spawn(move|| {
+            children.push(Thread::scoped(move|| {
                 let lock = arc3.read().unwrap();
                 assert!(*lock >= 0);
             }));
@@ -505,7 +505,7 @@ mod tests {
     fn test_rw_arc_access_in_unwind() {
         let arc = Arc::new(RwLock::new(1i));
         let arc2 = arc.clone();
-        let _ = Thread::spawn(move|| -> () {
+        let _ = Thread::scoped(move|| -> () {
             struct Unwinder {
                 i: Arc<RwLock<int>>,
             }