diff options
Diffstat (limited to 'tests/ui/threads-sendsync/mpsc_stress.rs')
| -rw-r--r-- | tests/ui/threads-sendsync/mpsc_stress.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/ui/threads-sendsync/mpsc_stress.rs b/tests/ui/threads-sendsync/mpsc_stress.rs index f5354c60bfc..fe0b47f3a84 100644 --- a/tests/ui/threads-sendsync/mpsc_stress.rs +++ b/tests/ui/threads-sendsync/mpsc_stress.rs @@ -2,18 +2,12 @@ //@ compile-flags:--test //@ needs-threads -use std::sync::mpsc::channel; -use std::sync::mpsc::TryRecvError; -use std::sync::mpsc::RecvError; -use std::sync::mpsc::RecvTimeoutError; +use std::sync::atomic::{AtomicUsize, Ordering}; +use std::sync::mpsc::{channel, RecvError, RecvTimeoutError, TryRecvError}; use std::sync::Arc; -use std::sync::atomic::AtomicUsize; -use std::sync::atomic::Ordering; - use std::thread; use std::time::Duration; - /// Simple thread synchronization utility struct Barrier { // Not using mutex/condvar for precision @@ -42,7 +36,6 @@ impl Barrier { } } - fn shared_close_sender_does_not_lose_messages_iter() { let (tb, rb) = Barrier::new2(); @@ -71,7 +64,6 @@ fn shared_close_sender_does_not_lose_messages() { }); } - // https://github.com/rust-lang/rust/issues/39364 fn concurrent_recv_timeout_and_upgrade_iter() { // 1 us @@ -85,8 +77,8 @@ fn concurrent_recv_timeout_and_upgrade_iter() { match rx.recv_timeout(sleep) { Ok(_) => { break; - }, - Err(_) => {}, + } + Err(_) => {} } } }); @@ -105,7 +97,6 @@ fn concurrent_recv_timeout_and_upgrade() { }); } - fn concurrent_writes_iter() { const THREADS: usize = 4; const PER_THR: usize = 100; |
