diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2015-01-20 15:51:09 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2015-01-20 22:15:44 +0100 |
| commit | cd631c6914d384538352604059a7e4abb31d8c46 (patch) | |
| tree | 628f7254ee3674c7b603721aefb8cc1aefba1c03 /src/libstd/sync/mpsc | |
| parent | 3bf41dafcfb6c979efb4e2438e047e1a54045eec (diff) | |
| download | rust-cd631c6914d384538352604059a7e4abb31d8c46.tar.gz rust-cd631c6914d384538352604059a7e4abb31d8c46.zip | |
Register snapshot for 9006c3c
Diffstat (limited to 'src/libstd/sync/mpsc')
| -rw-r--r-- | src/libstd/sync/mpsc/blocking.rs | 30 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 17 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 27 |
3 files changed, 0 insertions, 74 deletions
diff --git a/src/libstd/sync/mpsc/blocking.rs b/src/libstd/sync/mpsc/blocking.rs index 17e690e9540..61ffb532d36 100644 --- a/src/libstd/sync/mpsc/blocking.rs +++ b/src/libstd/sync/mpsc/blocking.rs @@ -14,8 +14,6 @@ use thread::Thread; use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering}; use sync::Arc; use marker::{Sync, Send}; -#[cfg(stage0)] // NOTE remove use after next snapshot -use marker::{NoSend, NoSync}; use mem; use clone::Clone; @@ -32,42 +30,14 @@ pub struct SignalToken { inner: Arc<Inner>, } -#[cfg(stage0)] // NOTE remove impl after next snapshot pub struct WaitToken { inner: Arc<Inner>, - no_send: NoSend, - no_sync: NoSync, } -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot -pub struct WaitToken { - inner: Arc<Inner>, -} - -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot impl !Send for WaitToken {} -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot impl !Sync for WaitToken {} -#[cfg(stage0)] // NOTE remove impl after next snapshot -pub fn tokens() -> (WaitToken, SignalToken) { - let inner = Arc::new(Inner { - thread: Thread::current(), - woken: ATOMIC_BOOL_INIT, - }); - let wait_token = WaitToken { - inner: inner.clone(), - no_send: NoSend, - no_sync: NoSync, - }; - let signal_token = SignalToken { - inner: inner - }; - (wait_token, signal_token) -} - -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot pub fn tokens() -> (WaitToken, SignalToken) { let inner = Arc::new(Inner { thread: Thread::current(), diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 0ba19b70617..375a85eb879 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -370,22 +370,10 @@ unsafe impl<T:Send> Send for Sender<T> { } /// The sending-half of Rust's synchronous channel type. This half can only be /// owned by one task, but it can be cloned to send to other tasks. #[stable] -#[cfg(stage0)] // NOTE remove impl after next snapshot pub struct SyncSender<T> { inner: Arc<RacyCell<sync::Packet<T>>>, - // can't share in an arc - _marker: marker::NoSync, } -/// The sending-half of Rust's synchronous channel type. This half can only be -/// owned by one task, but it can be cloned to send to other tasks. -#[stable] -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot -pub struct SyncSender<T> { - inner: Arc<RacyCell<sync::Packet<T>>>, -} - -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot impl<T> !marker::Sync for SyncSender<T> {} /// An error returned from the `send` function on channels. @@ -689,12 +677,7 @@ impl<T: Send> Drop for Sender<T> { //////////////////////////////////////////////////////////////////////////////// impl<T: Send> SyncSender<T> { - #[cfg(stage0)] // NOTE remove impl after next snapshot - fn new(inner: Arc<RacyCell<sync::Packet<T>>>) -> SyncSender<T> { - SyncSender { inner: inner, _marker: marker::NoSync } - } - #[cfg(not(stage0))] // NOTE remove cfg after next snapshot fn new(inner: Arc<RacyCell<sync::Packet<T>>>) -> SyncSender<T> { SyncSender { inner: inner } } diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 62a7b823ec8..e726b1f4846 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -66,24 +66,12 @@ use sync::mpsc::blocking::{self, SignalToken}; /// The "receiver set" of the select interface. This structure is used to manage /// a set of receivers which are being selected over. -#[cfg(stage0)] // NOTE remove impl after next snapshot pub struct Select { head: *mut Handle<'static, ()>, tail: *mut Handle<'static, ()>, next_id: Cell<uint>, - marker1: marker::NoSend, } -/// The "receiver set" of the select interface. This structure is used to manage -/// a set of receivers which are being selected over. -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot -pub struct Select { - head: *mut Handle<'static, ()>, - tail: *mut Handle<'static, ()>, - next_id: Cell<uint>, -} - -#[cfg(not(stage0))] // NOTE remove cfg after next snapshot impl !marker::Send for Select {} /// A handle to a receiver which is currently a member of a `Select` set of @@ -121,27 +109,12 @@ pub trait Packet { } impl Select { - /// Creates a new selection structure. This set is initially empty and - /// `wait` will panic!() if called. - /// - /// Usage of this struct directly can sometimes be burdensome, and usage is - /// rather much easier through the `select!` macro. - #[cfg(stage0)] // NOTE remove impl after next snapshot - pub fn new() -> Select { - Select { - marker1: marker::NoSend, - head: 0 as *mut Handle<'static, ()>, - tail: 0 as *mut Handle<'static, ()>, - next_id: Cell::new(1), - } - } /// Creates a new selection structure. This set is initially empty and /// `wait` will panic!() if called. /// /// Usage of this struct directly can sometimes be burdensome, and usage is /// rather much easier through the `select!` macro. - #[cfg(not(stage0))] // NOTE remove cfg after next snapshot pub fn new() -> Select { Select { head: 0 as *mut Handle<'static, ()>, |
