diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-12-12 21:38:57 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-12-24 19:59:52 -0800 |
| commit | 018d60509c04cdebdf8b0d9e2b58f2604538e516 (patch) | |
| tree | 00245c6192d883dbc4d45cbb10a314c4e2239d07 /src/libstd/sync/mpmc_bounded_queue.rs | |
| parent | d830fcc6eb5173061888d4b128c0670a49515f58 (diff) | |
| download | rust-018d60509c04cdebdf8b0d9e2b58f2604538e516.tar.gz rust-018d60509c04cdebdf8b0d9e2b58f2604538e516.zip | |
std: Get stdtest all passing again
This commit brings the library up-to-date in order to get all tests passing again
Diffstat (limited to 'src/libstd/sync/mpmc_bounded_queue.rs')
| -rw-r--r-- | src/libstd/sync/mpmc_bounded_queue.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libstd/sync/mpmc_bounded_queue.rs b/src/libstd/sync/mpmc_bounded_queue.rs index b623976306d..fe51de4e42d 100644 --- a/src/libstd/sync/mpmc_bounded_queue.rs +++ b/src/libstd/sync/mpmc_bounded_queue.rs @@ -163,8 +163,8 @@ impl<T: Send> Clone for Queue<T> { mod tests { use prelude::*; use option::*; - use task; use super::Queue; + use native; #[test] fn test() { @@ -172,14 +172,17 @@ mod tests { let nmsgs = 1000u; let mut q = Queue::with_capacity(nthreads*nmsgs); assert_eq!(None, q.pop()); + let (port, chan) = SharedChan::new(); for _ in range(0, nthreads) { let q = q.clone(); - do task::spawn_sched(task::SingleThreaded) { + let chan = chan.clone(); + do native::task::spawn { let mut q = q; for i in range(0, nmsgs) { assert!(q.push(i)); } + chan.send(()); } } @@ -188,7 +191,7 @@ mod tests { let (completion_port, completion_chan) = Chan::new(); completion_ports.push(completion_port); let q = q.clone(); - do task::spawn_sched(task::SingleThreaded) { + do native::task::spawn { let mut q = q; let mut i = 0u; loop { @@ -207,5 +210,8 @@ mod tests { for completion_port in completion_ports.mut_iter() { assert_eq!(nmsgs, completion_port.recv()); } + for _ in range(0, nthreads) { + port.recv(); + } } } |
