diff options
| author | Josh Stone <jistone@redhat.com> | 2019-05-17 11:36:25 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2019-05-17 12:16:52 -0700 |
| commit | f950193d74d13628537a04728eef25cec642e41b (patch) | |
| tree | 910a41889d17c9748e0e4551246fc511992a0cad /src/libstd/sync/mpsc/sync.rs | |
| parent | b982867a7349f84c17317599b59aeb5a7d8a83be (diff) | |
| download | rust-f950193d74d13628537a04728eef25cec642e41b.tar.gz rust-f950193d74d13628537a04728eef25cec642e41b.zip | |
Remove the unstable and deprecated mpsc_select
This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`,
which were all unstable and have been deprecated since 1.32.
Diffstat (limited to 'src/libstd/sync/mpsc/sync.rs')
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index b2d9f4c6491..3c4f8e077c9 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -33,7 +33,6 @@ use core::ptr; use crate::sync::atomic::{Ordering, AtomicUsize}; use crate::sync::mpsc::blocking::{self, WaitToken, SignalToken}; -use crate::sync::mpsc::select::StartResult::{self, Installed, Abort}; use crate::sync::{Mutex, MutexGuard}; use crate::time::Instant; @@ -406,42 +405,6 @@ impl<T> Packet<T> { while let Some(token) = queue.dequeue() { token.signal(); } waiter.map(|t| t.signal()); } - - //////////////////////////////////////////////////////////////////////////// - // select implementation - //////////////////////////////////////////////////////////////////////////// - - // If Ok, the value is whether this port has data, if Err, then the upgraded - // port needs to be checked instead of this one. - pub fn can_recv(&self) -> bool { - let guard = self.lock.lock().unwrap(); - guard.disconnected || guard.buf.size() > 0 - } - - // Attempts to start selection on this port. This can either succeed or fail - // because there is data waiting. - pub fn start_selection(&self, token: SignalToken) -> StartResult { - let mut guard = self.lock.lock().unwrap(); - if guard.disconnected || guard.buf.size() > 0 { - Abort - } else { - match mem::replace(&mut guard.blocker, BlockedReceiver(token)) { - NoneBlocked => {} - BlockedSender(..) => unreachable!(), - BlockedReceiver(..) => unreachable!(), - } - Installed - } - } - - // Remove a previous selecting thread from this port. This ensures that the - // blocked thread will no longer be visible to any other threads. - // - // The return value indicates whether there's data on this port. - pub fn abort_selection(&self) -> bool { - let mut guard = self.lock.lock().unwrap(); - abort_selection(&mut guard) - } } impl<T> Drop for Packet<T> { |
