diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-08-11 17:27:05 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-08-12 14:55:17 -0700 |
| commit | 8d90d3f36871a00023cc1f313f91e351c287ca15 (patch) | |
| tree | 2d9b616a2468117aa3afe1f6b1f910ff3116776b /src/libstd/sys/common/remutex.rs | |
| parent | d07d465cf60033e35eba16b9e431471d54c712f4 (diff) | |
| download | rust-8d90d3f36871a00023cc1f313f91e351c287ca15.tar.gz rust-8d90d3f36871a00023cc1f313f91e351c287ca15.zip | |
Remove all unstable deprecated functionality
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
Diffstat (limited to 'src/libstd/sys/common/remutex.rs')
| -rw-r--r-- | src/libstd/sys/common/remutex.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/sys/common/remutex.rs b/src/libstd/sys/common/remutex.rs index 8f416464173..20475c5463b 100644 --- a/src/libstd/sys/common/remutex.rs +++ b/src/libstd/sys/common/remutex.rs @@ -180,10 +180,11 @@ mod tests { #[test] fn is_mutex() { - let m = ReentrantMutex::new(RefCell::new(0)); + let m = Arc::new(ReentrantMutex::new(RefCell::new(0))); + let m2 = m.clone(); let lock = m.lock().unwrap(); - let handle = thread::scoped(|| { - let lock = m.lock().unwrap(); + let child = thread::spawn(move || { + let lock = m2.lock().unwrap(); assert_eq!(*lock.borrow(), 4950); }); for i in 0..100 { @@ -191,20 +192,19 @@ mod tests { *lock.borrow_mut() += i; } drop(lock); - drop(handle); + child.join().unwrap(); } #[test] fn trylock_works() { - let m = ReentrantMutex::new(()); + let m = Arc::new(ReentrantMutex::new(())); + let m2 = m.clone(); let lock = m.try_lock().unwrap(); let lock2 = m.try_lock().unwrap(); - { - thread::scoped(|| { - let lock = m.try_lock(); - assert!(lock.is_err()); - }); - } + thread::spawn(move || { + let lock = m2.try_lock(); + assert!(lock.is_err()); + }).join().unwrap(); let lock3 = m.try_lock().unwrap(); } |
