diff options
| author | Aaron Turon <aturon@mozilla.com> | 2015-02-17 15:10:25 -0800 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2015-02-17 15:14:17 -0800 |
| commit | d0de2b46e9bcca93971ef64d6ecdef872633f246 (patch) | |
| tree | 13c7a861124e388d180e2fd3a164160f3c0146d0 /src/libstd/sync | |
| parent | d8f8f7a58c7c8b3352c1c577347865f5a823fee3 (diff) | |
| download | rust-d0de2b46e9bcca93971ef64d6ecdef872633f246.tar.gz rust-d0de2b46e9bcca93971ef64d6ecdef872633f246.zip | |
Fallout from stabilization
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/barrier.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/condvar.rs | 16 | ||||
| -rw-r--r-- | src/libstd/sync/future.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/blocking.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 154 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 42 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/spsc_queue.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/stream.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 24 | ||||
| -rw-r--r-- | src/libstd/sync/once.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/poison.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 20 | ||||
| -rw-r--r-- | src/libstd/sync/semaphore.rs | 12 | ||||
| -rw-r--r-- | src/libstd/sync/task_pool.rs | 4 |
16 files changed, 163 insertions, 163 deletions
diff --git a/src/libstd/sync/barrier.rs b/src/libstd/sync/barrier.rs index cca376f7b6d..fc781eb4bec 100644 --- a/src/libstd/sync/barrier.rs +++ b/src/libstd/sync/barrier.rs @@ -15,14 +15,14 @@ use sync::{Mutex, Condvar}; /// /// ```rust /// use std::sync::{Arc, Barrier}; -/// use std::thread::Thread; +/// use std::thread; /// /// let barrier = Arc::new(Barrier::new(10)); /// for _ in 0u..10 { /// let c = barrier.clone(); /// // The same messages will be printed together. /// // You will NOT see any interleaving. -/// Thread::spawn(move|| { +/// thread::spawn(move|| { /// println!("before wait"); /// c.wait(); /// println!("after wait"); @@ -111,7 +111,7 @@ mod tests { use sync::{Arc, Barrier}; use sync::mpsc::{channel, TryRecvError}; - use thread::Thread; + use thread; #[test] fn test_barrier() { @@ -123,7 +123,7 @@ mod tests { for _ in 0u..N - 1 { let c = barrier.clone(); let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(c.wait().is_leader()).unwrap(); }); } diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index d4d722cab3d..52561d482c3 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -38,13 +38,13 @@ use sync::{mutex, MutexGuard, PoisonError}; /// /// ``` /// use std::sync::{Arc, Mutex, Condvar}; -/// use std::thread::Thread; +/// use std::thread; /// /// let pair = Arc::new((Mutex::new(false), Condvar::new())); /// let pair2 = pair.clone(); /// /// // Inside of our lock, spawn a new thread, and then wait for it to start -/// Thread::spawn(move|| { +/// thread::spawn(move|| { /// let &(ref lock, ref cvar) = &*pair2; /// let mut started = lock.lock().unwrap(); /// *started = true; @@ -353,7 +353,7 @@ mod tests { use sync::mpsc::channel; use sync::{StaticMutex, MUTEX_INIT, Condvar, Mutex, Arc}; use sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; - use thread::Thread; + use thread; use time::Duration; #[test] @@ -377,7 +377,7 @@ mod tests { static M: StaticMutex = MUTEX_INIT; let g = M.lock().unwrap(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let _g = M.lock().unwrap(); C.notify_one(); }); @@ -395,7 +395,7 @@ mod tests { for _ in 0..N { let data = data.clone(); let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { let &(ref lock, ref cond) = &*data; let mut cnt = lock.lock().unwrap(); *cnt += 1; @@ -431,7 +431,7 @@ mod tests { let (g, _no_timeout) = C.wait_timeout(g, Duration::nanoseconds(1000)).unwrap(); // spurious wakeups mean this isn't necessarily true // assert!(!no_timeout); - let _t = Thread::spawn(move || { + let _t = thread::spawn(move || { let _g = M.lock().unwrap(); C.notify_one(); }); @@ -452,7 +452,7 @@ mod tests { assert!(!success); let (tx, rx) = channel(); - let _t = Thread::scoped(move || { + let _t = thread::spawn(move || { rx.recv().unwrap(); let g = M.lock().unwrap(); S.store(1, Ordering::SeqCst); @@ -492,7 +492,7 @@ mod tests { static C: StaticCondvar = CONDVAR_INIT; let mut g = M1.lock().unwrap(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let _g = M1.lock().unwrap(); C.notify_one(); }); diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index a230e35dac8..ae5c1e1b4a5 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -38,7 +38,7 @@ use core::mem::replace; use self::FutureState::*; use sync::mpsc::{Receiver, channel}; use thunk::{Thunk}; -use thread::Thread; +use thread; /// A type encapsulating the result of a computation which may not be complete pub struct Future<A> { @@ -143,7 +143,7 @@ impl<A:Send> Future<A> { let (tx, rx) = channel(); - Thread::spawn(move || { + thread::spawn(move || { // Don't panic if the other end has hung up let _ = tx.send(blk()); }); @@ -157,7 +157,7 @@ mod test { use prelude::v1::*; use sync::mpsc::channel; use sync::Future; - use thread::Thread; + use thread; #[test] fn test_from_value() { @@ -215,7 +215,7 @@ mod test { let expected = "schlorf"; let (tx, rx) = channel(); let f = Future::spawn(move|| { expected }); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let mut f = f; tx.send(f.get()).unwrap(); }); diff --git a/src/libstd/sync/mpsc/blocking.rs b/src/libstd/sync/mpsc/blocking.rs index 61ffb532d36..69b1e242b15 100644 --- a/src/libstd/sync/mpsc/blocking.rs +++ b/src/libstd/sync/mpsc/blocking.rs @@ -10,7 +10,7 @@ //! Generic support for building blocking abstractions. -use thread::Thread; +use thread::{self, Thread}; use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; use sync::Arc; use marker::{Sync, Send}; @@ -40,7 +40,7 @@ impl !Sync for WaitToken {} pub fn tokens() -> (WaitToken, SignalToken) { let inner = Arc::new(Inner { - thread: Thread::current(), + thread: thread::current(), woken: ATOMIC_BOOL_INIT, }); let wait_token = WaitToken { @@ -80,7 +80,7 @@ impl SignalToken { impl WaitToken { pub fn wait(self) { while !self.inner.woken.load(Ordering::SeqCst) { - Thread::park() + thread::park() } } } diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index d783acd57ac..862745a05eb 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -53,12 +53,12 @@ //! Simple usage: //! //! ``` -//! use std::thread::Thread; +//! use std::thread; //! use std::sync::mpsc::channel; //! //! // Create a simple streaming channel //! let (tx, rx) = channel(); -//! Thread::spawn(move|| { +//! thread::spawn(move|| { //! tx.send(10).unwrap(); //! }); //! assert_eq!(rx.recv().unwrap(), 10); @@ -67,7 +67,7 @@ //! Shared usage: //! //! ``` -//! use std::thread::Thread; +//! use std::thread; //! use std::sync::mpsc::channel; //! //! // Create a shared channel that can be sent along from many threads @@ -76,7 +76,7 @@ //! let (tx, rx) = channel(); //! for i in 0..10 { //! let tx = tx.clone(); -//! Thread::spawn(move|| { +//! thread::spawn(move|| { //! tx.send(i).unwrap(); //! }); //! } @@ -102,11 +102,11 @@ //! Synchronous channels: //! //! ``` -//! use std::thread::Thread; +//! use std::thread; //! use std::sync::mpsc::sync_channel; //! //! let (tx, rx) = sync_channel::<int>(0); -//! Thread::spawn(move|| { +//! thread::spawn(move|| { //! // This will wait for the parent task to start receiving //! tx.send(53).unwrap(); //! }); @@ -467,14 +467,14 @@ impl<T> UnsafeFlavor<T> for Receiver<T> { /// /// ``` /// use std::sync::mpsc::channel; -/// use std::thread::Thread; +/// use std::thread; /// /// // tx is is the sending half (tx for transmission), and rx is the receiving /// // half (rx for receiving). /// let (tx, rx) = channel(); /// /// // Spawn off an expensive computation -/// Thread::spawn(move|| { +/// thread::spawn(move|| { /// # fn expensive_computation() {} /// tx.send(expensive_computation()).unwrap(); /// }); @@ -509,14 +509,14 @@ pub fn channel<T: Send>() -> (Sender<T>, Receiver<T>) { /// /// ``` /// use std::sync::mpsc::sync_channel; -/// use std::thread::Thread; +/// use std::thread; /// /// let (tx, rx) = sync_channel(1); /// /// // this returns immediately /// tx.send(1).unwrap(); /// -/// Thread::spawn(move|| { +/// thread::spawn(move|| { /// // this will block until the previous message has been received /// tx.send(2).unwrap(); /// }); @@ -1026,7 +1026,7 @@ mod test { use std::env; use super::*; - use thread::Thread; + use thread; pub fn stress_factor() -> uint { match env::var("RUST_TEST_STRESS") { @@ -1069,7 +1069,7 @@ mod test { #[test] fn smoke_threads() { let (tx, rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { tx.send(1).unwrap(); }); assert_eq!(rx.recv().unwrap(), 1); @@ -1101,7 +1101,7 @@ mod test { #[test] fn port_gone_concurrent() { let (tx, rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); }); while tx.send(1).is_ok() {} @@ -1111,7 +1111,7 @@ mod test { fn port_gone_concurrent_shared() { let (tx, rx) = channel::<int>(); let tx2 = tx.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); }); while tx.send(1).is_ok() && tx2.send(1).is_ok() {} @@ -1136,7 +1136,7 @@ mod test { #[test] fn chan_gone_concurrent() { let (tx, rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { tx.send(1).unwrap(); tx.send(1).unwrap(); }); @@ -1146,7 +1146,7 @@ mod test { #[test] fn stress() { let (tx, rx) = channel::<int>(); - let t = Thread::scoped(move|| { + let t = thread::spawn(move|| { for _ in 0u..10000 { tx.send(1).unwrap(); } }); for _ in 0u..10000 { @@ -1161,7 +1161,7 @@ mod test { static NTHREADS: uint = 8; let (tx, rx) = channel::<int>(); - let t = Thread::scoped(move|| { + let t = thread::spawn(move|| { for _ in 0..AMT * NTHREADS { assert_eq!(rx.recv().unwrap(), 1); } @@ -1173,7 +1173,7 @@ mod test { for _ in 0..NTHREADS { let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { for _ in 0..AMT { tx.send(1).unwrap(); } }); } @@ -1185,14 +1185,14 @@ mod test { fn send_from_outside_runtime() { let (tx1, rx1) = channel::<()>(); let (tx2, rx2) = channel::<int>(); - let t1 = Thread::scoped(move|| { + let t1 = thread::spawn(move|| { tx1.send(()).unwrap(); for _ in 0..40 { assert_eq!(rx2.recv().unwrap(), 1); } }); rx1.recv().unwrap(); - let t2 = Thread::scoped(move|| { + let t2 = thread::spawn(move|| { for _ in 0..40 { tx2.send(1).unwrap(); } @@ -1204,7 +1204,7 @@ mod test { #[test] fn recv_from_outside_runtime() { let (tx, rx) = channel::<int>(); - let t = Thread::scoped(move|| { + let t = thread::spawn(move|| { for _ in 0..40 { assert_eq!(rx.recv().unwrap(), 1); } @@ -1219,11 +1219,11 @@ mod test { fn no_runtime() { let (tx1, rx1) = channel::<int>(); let (tx2, rx2) = channel::<int>(); - let t1 = Thread::scoped(move|| { + let t1 = thread::spawn(move|| { assert_eq!(rx1.recv().unwrap(), 1); tx2.send(2).unwrap(); }); - let t2 = Thread::scoped(move|| { + let t2 = thread::spawn(move|| { tx1.send(1).unwrap(); assert_eq!(rx2.recv().unwrap(), 2); }); @@ -1256,7 +1256,7 @@ mod test { #[test] fn oneshot_single_thread_recv_chan_close() { // Receiving on a closed chan will panic - let res = Thread::scoped(move|| { + let res = thread::spawn(move|| { let (tx, rx) = channel::<int>(); drop(tx); rx.recv().unwrap(); @@ -1325,7 +1325,7 @@ mod test { #[test] fn oneshot_multi_task_recv_then_send() { let (tx, rx) = channel::<Box<int>>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { assert!(rx.recv().unwrap() == box 10); }); @@ -1335,10 +1335,10 @@ mod test { #[test] fn oneshot_multi_task_recv_then_close() { let (tx, rx) = channel::<Box<int>>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(tx); }); - let res = Thread::scoped(move|| { + let res = thread::spawn(move|| { assert!(rx.recv().unwrap() == box 10); }).join(); assert!(res.is_err()); @@ -1348,7 +1348,7 @@ mod test { fn oneshot_multi_thread_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(rx); }); drop(tx); @@ -1359,10 +1359,10 @@ mod test { fn oneshot_multi_thread_send_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(rx); }); - let _ = Thread::scoped(move|| { + let _ = thread::spawn(move|| { tx.send(1).unwrap(); }).join(); } @@ -1372,14 +1372,14 @@ mod test { fn oneshot_multi_thread_recv_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = channel::<int>(); - Thread::spawn(move|| { - let res = Thread::scoped(move|| { + thread::spawn(move|| { + let res = thread::spawn(move|| { rx.recv().unwrap(); }).join(); assert!(res.is_err()); }); - let _t = Thread::spawn(move|| { - Thread::spawn(move|| { + let _t = thread::spawn(move|| { + thread::spawn(move|| { drop(tx); }); }); @@ -1390,7 +1390,7 @@ mod test { fn oneshot_multi_thread_send_recv_stress() { for _ in 0..stress_factor() { let (tx, rx) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { tx.send(box 10).unwrap(); }); assert!(rx.recv().unwrap() == box 10); @@ -1408,7 +1408,7 @@ mod test { fn send(tx: Sender<Box<int>>, i: int) { if i == 10 { return } - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(box i).unwrap(); send(tx, i + 1); }); @@ -1417,7 +1417,7 @@ mod test { fn recv(rx: Receiver<Box<int>>, i: int) { if i == 10 { return } - Thread::spawn(move|| { + thread::spawn(move|| { assert!(rx.recv().unwrap() == box i); recv(rx, i + 1); }); @@ -1439,7 +1439,7 @@ mod test { let total = stress_factor() + 100; for _ in 0..total { let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(()).unwrap(); }); } @@ -1454,7 +1454,7 @@ mod test { let (tx, rx) = channel::<int>(); let (total_tx, total_rx) = channel::<int>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let mut acc = 0; for x in rx.iter() { acc += x; @@ -1474,7 +1474,7 @@ mod test { let (tx, rx) = channel::<int>(); let (count_tx, count_rx) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let mut count = 0; for x in rx.iter() { if count >= 3 { @@ -1499,7 +1499,7 @@ mod test { let (tx1, rx1) = channel::<int>(); let (tx2, rx2) = channel::<()>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx2.recv().unwrap(); tx1.send(1).unwrap(); tx3.send(()).unwrap(); @@ -1524,13 +1524,13 @@ mod test { fn destroy_upgraded_shared_port_when_sender_still_active() { let (tx, rx) = channel(); let (tx2, rx2) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); // wait on a oneshot drop(rx); // destroy a shared tx2.send(()).unwrap(); }); // make sure the other task has gone to sleep - for _ in 0u..5000 { Thread::yield_now(); } + for _ in 0u..5000 { thread::yield_now(); } // upgrade to a shared chan and send a message let t = tx.clone(); @@ -1547,7 +1547,7 @@ mod sync_tests { use prelude::v1::*; use std::env; - use thread::Thread; + use thread; use super::*; pub fn stress_factor() -> uint { @@ -1583,7 +1583,7 @@ mod sync_tests { #[test] fn smoke_threads() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { tx.send(1).unwrap(); }); assert_eq!(rx.recv().unwrap(), 1); @@ -1608,7 +1608,7 @@ mod sync_tests { #[test] fn port_gone_concurrent() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); }); while tx.send(1).is_ok() {} @@ -1618,7 +1618,7 @@ mod sync_tests { fn port_gone_concurrent_shared() { let (tx, rx) = sync_channel::<int>(0); let tx2 = tx.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); }); while tx.send(1).is_ok() && tx2.send(1).is_ok() {} @@ -1643,7 +1643,7 @@ mod sync_tests { #[test] fn chan_gone_concurrent() { let (tx, rx) = sync_channel::<int>(0); - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(1).unwrap(); tx.send(1).unwrap(); }); @@ -1653,7 +1653,7 @@ mod sync_tests { #[test] fn stress() { let (tx, rx) = sync_channel::<int>(0); - Thread::spawn(move|| { + thread::spawn(move|| { for _ in 0u..10000 { tx.send(1).unwrap(); } }); for _ in 0u..10000 { @@ -1668,7 +1668,7 @@ mod sync_tests { let (tx, rx) = sync_channel::<int>(0); let (dtx, drx) = sync_channel::<()>(0); - Thread::spawn(move|| { + thread::spawn(move|| { for _ in 0..AMT * NTHREADS { assert_eq!(rx.recv().unwrap(), 1); } @@ -1681,7 +1681,7 @@ mod sync_tests { for _ in 0..NTHREADS { let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { for _ in 0..AMT { tx.send(1).unwrap(); } }); } @@ -1714,7 +1714,7 @@ mod sync_tests { #[test] fn oneshot_single_thread_recv_chan_close() { // Receiving on a closed chan will panic - let res = Thread::scoped(move|| { + let res = thread::spawn(move|| { let (tx, rx) = sync_channel::<int>(0); drop(tx); rx.recv().unwrap(); @@ -1789,7 +1789,7 @@ mod sync_tests { #[test] fn oneshot_multi_task_recv_then_send() { let (tx, rx) = sync_channel::<Box<int>>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { assert!(rx.recv().unwrap() == box 10); }); @@ -1799,10 +1799,10 @@ mod sync_tests { #[test] fn oneshot_multi_task_recv_then_close() { let (tx, rx) = sync_channel::<Box<int>>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(tx); }); - let res = Thread::scoped(move|| { + let res = thread::spawn(move|| { assert!(rx.recv().unwrap() == box 10); }).join(); assert!(res.is_err()); @@ -1812,7 +1812,7 @@ mod sync_tests { fn oneshot_multi_thread_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(rx); }); drop(tx); @@ -1823,10 +1823,10 @@ mod sync_tests { fn oneshot_multi_thread_send_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { drop(rx); }); - let _ = Thread::scoped(move || { + let _ = thread::spawn(move || { tx.send(1).unwrap(); }).join(); } @@ -1836,14 +1836,14 @@ mod sync_tests { fn oneshot_multi_thread_recv_close_stress() { for _ in 0..stress_factor() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { - let res = Thread::scoped(move|| { + let _t = thread::spawn(move|| { + let res = thread::spawn(move|| { rx.recv().unwrap(); }).join(); assert!(res.is_err()); }); - let _t = Thread::spawn(move|| { - Thread::spawn(move|| { + let _t = thread::spawn(move|| { + thread::spawn(move|| { drop(tx); }); }); @@ -1854,7 +1854,7 @@ mod sync_tests { fn oneshot_multi_thread_send_recv_stress() { for _ in 0..stress_factor() { let (tx, rx) = sync_channel::<Box<int>>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { tx.send(box 10).unwrap(); }); assert!(rx.recv().unwrap() == box 10); @@ -1872,7 +1872,7 @@ mod sync_tests { fn send(tx: SyncSender<Box<int>>, i: int) { if i == 10 { return } - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(box i).unwrap(); send(tx, i + 1); }); @@ -1881,7 +1881,7 @@ mod sync_tests { fn recv(rx: Receiver<Box<int>>, i: int) { if i == 10 { return } - Thread::spawn(move|| { + thread::spawn(move|| { assert!(rx.recv().unwrap() == box i); recv(rx, i + 1); }); @@ -1903,7 +1903,7 @@ mod sync_tests { let total = stress_factor() + 100; for _ in 0..total { let tx = tx.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(()).unwrap(); }); } @@ -1918,7 +1918,7 @@ mod sync_tests { let (tx, rx) = sync_channel::<int>(0); let (total_tx, total_rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let mut acc = 0; for x in rx.iter() { acc += x; @@ -1938,7 +1938,7 @@ mod sync_tests { let (tx, rx) = sync_channel::<int>(0); let (count_tx, count_rx) = sync_channel(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let mut count = 0; for x in rx.iter() { if count >= 3 { @@ -1963,7 +1963,7 @@ mod sync_tests { let (tx1, rx1) = sync_channel::<int>(1); let (tx2, rx2) = sync_channel::<()>(1); let (tx3, rx3) = sync_channel::<()>(1); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx2.recv().unwrap(); tx1.send(1).unwrap(); tx3.send(()).unwrap(); @@ -1988,13 +1988,13 @@ mod sync_tests { fn destroy_upgraded_shared_port_when_sender_still_active() { let (tx, rx) = sync_channel::<()>(0); let (tx2, rx2) = sync_channel::<()>(0); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx.recv().unwrap(); // wait on a oneshot drop(rx); // destroy a shared tx2.send(()).unwrap(); }); // make sure the other task has gone to sleep - for _ in 0u..5000 { Thread::yield_now(); } + for _ in 0u..5000 { thread::yield_now(); } // upgrade to a shared chan and send a message let t = tx.clone(); @@ -2008,14 +2008,14 @@ mod sync_tests { #[test] fn send1() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { rx.recv().unwrap(); }); + let _t = thread::spawn(move|| { rx.recv().unwrap(); }); assert_eq!(tx.send(1), Ok(())); } #[test] fn send2() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { drop(rx); }); + let _t = thread::spawn(move|| { drop(rx); }); assert!(tx.send(1).is_err()); } @@ -2023,7 +2023,7 @@ mod sync_tests { fn send3() { let (tx, rx) = sync_channel::<int>(1); assert_eq!(tx.send(1), Ok(())); - let _t =Thread::spawn(move|| { drop(rx); }); + let _t =thread::spawn(move|| { drop(rx); }); assert!(tx.send(1).is_err()); } @@ -2033,11 +2033,11 @@ mod sync_tests { let tx2 = tx.clone(); let (done, donerx) = channel(); let done2 = done.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { assert!(tx.send(1).is_err()); done.send(()).unwrap(); }); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { assert!(tx2.send(2).is_err()); done2.send(()).unwrap(); }); @@ -2073,7 +2073,7 @@ mod sync_tests { let (tx1, rx1) = sync_channel::<()>(3); let (tx2, rx2) = sync_channel::<()>(3); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx1.recv().unwrap(); tx2.try_send(()).unwrap(); }); diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 3980d2a1fef..c374f8bbcee 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -160,7 +160,7 @@ mod tests { use sync::mpsc::channel; use super::{Queue, Data, Empty, Inconsistent}; use sync::Arc; - use thread::Thread; + use thread; #[test] fn test_full() { @@ -184,7 +184,7 @@ mod tests { for _ in 0..nthreads { let tx = tx.clone(); let q = q.clone(); - Thread::spawn(move|| { + thread::spawn(move|| { for i in 0..nmsgs { q.push(i); } diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 87b2fe8f100..652a9ebb020 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -347,7 +347,7 @@ impl Iterator for Packets { mod test { use prelude::v1::*; - use thread::Thread; + use thread; use sync::mpsc::*; // Don't use the libstd version so we can pull in the right Select structure @@ -427,11 +427,11 @@ mod test { let (_tx2, rx2) = channel::<int>(); let (tx3, rx3) = channel::<int>(); - let _t = Thread::spawn(move|| { - for _ in 0u..20 { Thread::yield_now(); } + let _t = thread::spawn(move|| { + for _ in 0u..20 { thread::yield_now(); } tx1.send(1).unwrap(); rx3.recv().unwrap(); - for _ in 0u..20 { Thread::yield_now(); } + for _ in 0u..20 { thread::yield_now(); } }); select! { @@ -451,8 +451,8 @@ mod test { let (tx2, rx2) = channel::<int>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { - for _ in 0u..20 { Thread::yield_now(); } + let _t = thread::spawn(move|| { + for _ in 0u..20 { thread::yield_now(); } tx1.send(1).unwrap(); tx2.send(2).unwrap(); rx3.recv().unwrap(); @@ -478,7 +478,7 @@ mod test { let (tx2, rx2) = channel::<int>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { for i in 0..AMT { if i % 2 == 0 { tx1.send(i).unwrap(); @@ -504,7 +504,7 @@ mod test { let (_tx2, rx2) = channel::<int>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx3.recv().unwrap(); tx1.clone(); assert_eq!(rx3.try_recv(), Err(TryRecvError::Empty)); @@ -526,7 +526,7 @@ mod test { let (_tx2, rx2) = channel::<int>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { rx3.recv().unwrap(); tx1.clone(); assert_eq!(rx3.try_recv(), Err(TryRecvError::Empty)); @@ -547,7 +547,7 @@ mod test { let (tx1, rx1) = channel::<()>(); let (tx2, rx2) = channel::<()>(); let (tx3, rx3) = channel::<()>(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let s = Select::new(); let mut h1 = s.handle(&rx1); let mut h2 = s.handle(&rx2); @@ -557,7 +557,7 @@ mod test { tx3.send(()).unwrap(); }); - for _ in 0u..1000 { Thread::yield_now(); } + for _ in 0u..1000 { thread::yield_now(); } drop(tx1.clone()); tx2.send(()).unwrap(); rx3.recv().unwrap(); @@ -663,14 +663,14 @@ mod test { fn oneshot_data_waiting() { let (tx1, rx1) = channel(); let (tx2, rx2) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { select! { _n = rx1.recv() => {} } tx2.send(()).unwrap(); }); - for _ in 0u..100 { Thread::yield_now() } + for _ in 0u..100 { thread::yield_now() } tx1.send(()).unwrap(); rx2.recv().unwrap(); } @@ -683,14 +683,14 @@ mod test { tx1.send(()).unwrap(); rx1.recv().unwrap(); rx1.recv().unwrap(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { select! { _n = rx1.recv() => {} } tx2.send(()).unwrap(); }); - for _ in 0u..100 { Thread::yield_now() } + for _ in 0u..100 { thread::yield_now() } tx1.send(()).unwrap(); rx2.recv().unwrap(); } @@ -702,14 +702,14 @@ mod test { drop(tx1.clone()); tx1.send(()).unwrap(); rx1.recv().unwrap(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { select! { _n = rx1.recv() => {} } tx2.send(()).unwrap(); }); - for _ in 0u..100 { Thread::yield_now() } + for _ in 0u..100 { thread::yield_now() } tx1.send(()).unwrap(); rx2.recv().unwrap(); } @@ -726,8 +726,8 @@ mod test { #[test] fn sync2() { let (tx, rx) = sync_channel::<int>(0); - let _t = Thread::spawn(move|| { - for _ in 0u..100 { Thread::yield_now() } + let _t = thread::spawn(move|| { + for _ in 0u..100 { thread::yield_now() } tx.send(1).unwrap(); }); select! { @@ -739,8 +739,8 @@ mod test { fn sync3() { let (tx1, rx1) = sync_channel::<int>(0); let (tx2, rx2): (Sender<int>, Receiver<int>) = channel(); - let _t = Thread::spawn(move|| { tx1.send(1).unwrap(); }); - let _t = Thread::spawn(move|| { tx2.send(2).unwrap(); }); + let _t = thread::spawn(move|| { tx1.send(1).unwrap(); }); + let _t = thread::spawn(move|| { tx2.send(2).unwrap(); }); select! { n = rx1.recv() => { let n = n.unwrap(); diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index 6c31fb92591..729e7991f97 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -31,7 +31,7 @@ use sync::mpsc::mpsc_queue as mpsc; use sync::mpsc::select::StartResult::*; use sync::mpsc::select::StartResult; use sync::{Mutex, MutexGuard}; -use thread::Thread; +use thread; const DISCONNECTED: isize = isize::MIN; const FUDGE: isize = 1024; @@ -194,7 +194,7 @@ impl<T: Send> Packet<T> { match self.queue.pop() { mpsc::Data(..) => {} mpsc::Empty => break, - mpsc::Inconsistent => Thread::yield_now(), + mpsc::Inconsistent => thread::yield_now(), } } // maybe we're done, if we're not the last ones @@ -283,7 +283,7 @@ impl<T: Send> Packet<T> { mpsc::Inconsistent => { let data; loop { - Thread::yield_now(); + thread::yield_now(); match self.queue.pop() { mpsc::Data(t) => { data = t; break } mpsc::Empty => panic!("inconsistent => empty"), @@ -460,7 +460,7 @@ impl<T: Send> Packet<T> { drop(self.take_to_wake()); } else { while self.to_wake.load(Ordering::SeqCst) != 0 { - Thread::yield_now(); + thread::yield_now(); } } // if the number of steals is -1, it was the pre-emptive -1 steal diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index f0558c33d1e..c03bf024818 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -246,7 +246,7 @@ mod test { use sync::Arc; use super::Queue; - use thread::Thread; + use thread; use sync::mpsc::channel; #[test] @@ -324,7 +324,7 @@ mod test { let (tx, rx) = channel(); let q2 = q.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { for _ in 0u..100000 { loop { match q2.pop() { diff --git a/src/libstd/sync/mpsc/stream.rs b/src/libstd/sync/mpsc/stream.rs index ab9bd6b2ed7..2d528662f64 100644 --- a/src/libstd/sync/mpsc/stream.rs +++ b/src/libstd/sync/mpsc/stream.rs @@ -26,7 +26,7 @@ use core::prelude::*; use core::cmp; use core::isize; -use thread::Thread; +use thread; use sync::atomic::{AtomicIsize, AtomicUsize, Ordering, AtomicBool}; use sync::mpsc::Receiver; @@ -440,7 +440,7 @@ impl<T: Send> Packet<T> { drop(self.take_to_wake()); } else { while self.to_wake.load(Ordering::SeqCst) != 0 { - Thread::yield_now(); + thread::yield_now(); } } assert_eq!(self.steals, 0); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 74692c1273c..d7e8419f19f 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -47,7 +47,7 @@ use sys_common::mutex as sys; /// /// ```rust /// use std::sync::{Arc, Mutex}; -/// use std::thread::Thread; +/// use std::thread; /// use std::sync::mpsc::channel; /// /// const N: uint = 10; @@ -62,7 +62,7 @@ use sys_common::mutex as sys; /// let (tx, rx) = channel(); /// for _ in 0u..10 { /// let (data, tx) = (data.clone(), tx.clone()); -/// Thread::spawn(move || { +/// thread::spawn(move || { /// // The shared static can only be accessed once the lock is held. /// // Our non-atomic increment is safe because we're the only thread /// // which can access the shared state when the lock is held. @@ -85,12 +85,12 @@ use sys_common::mutex as sys; /// /// ```rust /// use std::sync::{Arc, Mutex}; -/// use std::thread::Thread; +/// use std::thread; /// /// let lock = Arc::new(Mutex::new(0u)); /// let lock2 = lock.clone(); /// -/// let _ = Thread::scoped(move || -> () { +/// let _ = thread::spawn(move || -> () { /// // This thread will acquire the mutex first, unwrapping the result of /// // `lock` because the lock has not been poisoned. /// let _lock = lock2.lock().unwrap(); @@ -350,7 +350,7 @@ mod test { use sync::mpsc::channel; use sync::{Arc, Mutex, StaticMutex, MUTEX_INIT, Condvar}; - use thread::Thread; + use thread; struct Packet<T>(Arc<(Mutex<T>, Condvar)>); @@ -393,9 +393,9 @@ mod test { let (tx, rx) = channel(); for _ in 0..K { let tx2 = tx.clone(); - Thread::spawn(move|| { inc(); tx2.send(()).unwrap(); }); + thread::spawn(move|| { inc(); tx2.send(()).unwrap(); }); let tx2 = tx.clone(); - Thread::spawn(move|| { inc(); tx2.send(()).unwrap(); }); + thread::spawn(move|| { inc(); tx2.send(()).unwrap(); }); } drop(tx); @@ -419,7 +419,7 @@ mod test { let packet = Packet(Arc::new((Mutex::new(false), Condvar::new()))); let packet2 = Packet(packet.0.clone()); let (tx, rx) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { // wait until parent gets in rx.recv().unwrap(); let &(ref lock, ref cvar) = &*packet2.0; @@ -443,7 +443,7 @@ mod test { let packet2 = Packet(packet.0.clone()); let (tx, rx) = channel(); - let _t = Thread::spawn(move || -> () { + let _t = thread::spawn(move || -> () { rx.recv().unwrap(); let &(ref lock, ref cvar) = &*packet2.0; let _g = lock.lock().unwrap(); @@ -471,7 +471,7 @@ mod test { let arc = Arc::new(Mutex::new(1)); assert!(!arc.is_poisoned()); let arc2 = arc.clone(); - let _ = Thread::scoped(move|| { + let _ = thread::spawn(move|| { let lock = arc2.lock().unwrap(); assert_eq!(*lock, 2); }).join(); @@ -486,7 +486,7 @@ mod test { let arc = Arc::new(Mutex::new(1)); let arc2 = Arc::new(Mutex::new(arc)); let (tx, rx) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let lock = arc2.lock().unwrap(); let lock2 = lock.lock().unwrap(); assert_eq!(*lock2, 1); @@ -499,7 +499,7 @@ mod test { fn test_mutex_arc_access_in_unwind() { let arc = Arc::new(Mutex::new(1)); let arc2 = arc.clone(); - let _ = Thread::scoped(move|| -> () { + let _ = thread::spawn(move|| -> () { struct Unwinder { i: Arc<Mutex<int>>, } diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 29c2051e5ad..1e87c0d612b 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -127,7 +127,7 @@ impl Once { mod test { use prelude::v1::*; - use thread::Thread; + use thread; use super::{ONCE_INIT, Once}; use sync::mpsc::channel; @@ -149,8 +149,8 @@ mod test { let (tx, rx) = channel(); for _ in 0u..10 { let tx = tx.clone(); - Thread::spawn(move|| { - for _ in 0u..4 { Thread::yield_now() } + thread::spawn(move|| { + for _ in 0u..4 { thread::yield_now() } unsafe { O.call_once(|| { assert!(!run); diff --git a/src/libstd/sync/poison.rs b/src/libstd/sync/poison.rs index a93bd31f5ae..32c8150ba40 100644 --- a/src/libstd/sync/poison.rs +++ b/src/libstd/sync/poison.rs @@ -13,7 +13,7 @@ use prelude::v1::*; use cell::UnsafeCell; use error::{Error, FromError}; use fmt; -use thread::Thread; +use thread; pub struct Flag { failed: UnsafeCell<bool> } pub const FLAG_INIT: Flag = Flag { failed: UnsafeCell { value: false } }; @@ -21,7 +21,7 @@ pub const FLAG_INIT: Flag = Flag { failed: UnsafeCell { value: false } }; impl Flag { #[inline] pub fn borrow(&self) -> LockResult<Guard> { - let ret = Guard { panicking: Thread::panicking() }; + let ret = Guard { panicking: thread::panicking() }; if unsafe { *self.failed.get() } { Err(PoisonError::new(ret)) } else { @@ -31,7 +31,7 @@ impl Flag { #[inline] pub fn done(&self, guard: &Guard) { - if !guard.panicking && Thread::panicking() { + if !guard.panicking && thread::panicking() { unsafe { *self.failed.get() = true; } } } diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index c4f1f2ccadd..402542b8bdc 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] @@ -431,7 +431,7 @@ mod tests { 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<uint, _> = 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<uint, _> = 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<uint, _> = 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<uint, _> = 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>>, } diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs index 0304b898884..410e1c11bb9 100644 --- a/src/libstd/sync/semaphore.rs +++ b/src/libstd/sync/semaphore.rs @@ -114,7 +114,7 @@ mod tests { use sync::Arc; use super::Semaphore; use sync::mpsc::channel; - use thread::Thread; + use thread; #[test] fn test_sem_acquire_release() { @@ -134,7 +134,7 @@ mod tests { fn test_sem_as_mutex() { let s = Arc::new(Semaphore::new(1)); let s2 = s.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let _g = s2.access(); }); let _g = s.access(); @@ -146,7 +146,7 @@ mod tests { let (tx, rx) = channel(); let s = Arc::new(Semaphore::new(0)); let s2 = s.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { s2.acquire(); tx.send(()).unwrap(); }); @@ -157,7 +157,7 @@ mod tests { let (tx, rx) = channel(); let s = Arc::new(Semaphore::new(0)); let s2 = s.clone(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { s2.release(); let _ = rx.recv(); }); @@ -173,7 +173,7 @@ mod tests { let s2 = s.clone(); let (tx1, rx1) = channel(); let (tx2, rx2) = channel(); - let _t = Thread::spawn(move|| { + let _t = thread::spawn(move|| { let _g = s2.access(); let _ = rx2.recv(); tx1.send(()).unwrap(); @@ -190,7 +190,7 @@ mod tests { let (tx, rx) = channel(); { let _g = s.access(); - Thread::spawn(move|| { + thread::spawn(move|| { tx.send(()).unwrap(); drop(s2.access()); tx.send(()).unwrap(); diff --git a/src/libstd/sync/task_pool.rs b/src/libstd/sync/task_pool.rs index 684a46fd6ff..06c0c84c418 100644 --- a/src/libstd/sync/task_pool.rs +++ b/src/libstd/sync/task_pool.rs @@ -20,7 +20,7 @@ use core::prelude::*; use sync::{Arc, Mutex}; use sync::mpsc::{channel, Sender, Receiver}; -use thread::Thread; +use thread; use thunk::Thunk; struct Sentinel<'a> { @@ -112,7 +112,7 @@ impl TaskPool { } fn spawn_in_pool(jobs: Arc<Mutex<Receiver<Thunk>>>) { - Thread::spawn(move || { + thread::spawn(move || { // Will spawn a new thread on panic unless it is cancelled. let sentinel = Sentinel::new(&jobs); |
