about summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-06-09 18:15:22 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-06-17 09:06:59 -0700
commit6895311e859e1859f9b3f0adc9f1fbb4d2891534 (patch)
treeabefb3b1f9caa3a3d60f86439b4e6550a54f7692 /src/libstd/sync
parentd444d0c357e85c90e73585520e2da74304c7265a (diff)
downloadrust-6895311e859e1859f9b3f0adc9f1fbb4d2891534.tar.gz
rust-6895311e859e1859f9b3f0adc9f1fbb4d2891534.zip
std: Split the `std_misc` feature
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/future.rs2
-rw-r--r--src/libstd/sync/mpsc/mpsc_queue.rs2
-rw-r--r--src/libstd/sync/mpsc/select.rs6
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs2
-rw-r--r--src/libstd/sync/mutex.rs19
-rw-r--r--src/libstd/sync/once.rs2
-rw-r--r--src/libstd/sync/rwlock.rs22
-rw-r--r--src/libstd/sync/semaphore.rs2
8 files changed, 18 insertions, 39 deletions
diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs
index 2d281eb4e24..76b07999280 100644
--- a/src/libstd/sync/future.rs
+++ b/src/libstd/sync/future.rs
@@ -28,7 +28,7 @@
 //! ```
 
 #![allow(missing_docs)]
-#![unstable(feature = "std_misc",
+#![unstable(feature = "future",
             reason = "futures as-is have yet to be deeply reevaluated with recent \
                       core changes to Rust's synchronization story, and will likely \
                       become stable in the future but are unstable until that time")]
diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs
index 2c0da938cbf..f3edf0d68c7 100644
--- a/src/libstd/sync/mpsc/mpsc_queue.rs
+++ b/src/libstd/sync/mpsc/mpsc_queue.rs
@@ -35,8 +35,6 @@
 //! method, and see the method for more information about it. Due to this
 //! caveat, this queue may not be appropriate for all use-cases.
 
-#![unstable(feature = "std_misc")]
-
 // http://www.1024cores.net/home/lock-free-algorithms
 //                         /queues/non-intrusive-mpsc-node-based-queue
 
diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs
index 679cc550454..a67138742ae 100644
--- a/src/libstd/sync/mpsc/select.rs
+++ b/src/libstd/sync/mpsc/select.rs
@@ -27,7 +27,7 @@
 //! # Examples
 //!
 //! ```rust
-//! # #![feature(std_misc)]
+//! # #![feature(mpsc_select)]
 //! use std::sync::mpsc::channel;
 //!
 //! let (tx1, rx1) = channel();
@@ -47,7 +47,7 @@
 //! ```
 
 #![allow(dead_code)]
-#![unstable(feature = "std_misc",
+#![unstable(feature = "mpsc_select",
             reason = "This implementation, while likely sufficient, is unsafe and \
                       likely to be error prone. At some point in the future this \
                       module will likely be replaced, and it is currently \
@@ -124,7 +124,7 @@ impl Select {
     /// # Examples
     ///
     /// ```
-    /// # #![feature(std_misc)]
+    /// # #![feature(mpsc_select)]
     /// use std::sync::mpsc::Select;
     ///
     /// let select = Select::new();
diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs
index a0ed52d4d3c..770068a66be 100644
--- a/src/libstd/sync/mpsc/spsc_queue.rs
+++ b/src/libstd/sync/mpsc/spsc_queue.rs
@@ -33,8 +33,6 @@
 //! concurrently between two threads. This data structure is safe to use and
 //! enforces the semantics that there is one pusher and one popper.
 
-#![unstable(feature = "std_misc")]
-
 use core::prelude::*;
 
 use alloc::boxed;
diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs
index fd22d723ebd..5f77ee20545 100644
--- a/src/libstd/sync/mutex.rs
+++ b/src/libstd/sync/mutex.rs
@@ -85,7 +85,6 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
 /// To recover from a poisoned mutex:
 ///
 /// ```
-/// # #![feature(std_misc)]
 /// use std::sync::{Arc, Mutex};
 /// use std::thread;
 ///
@@ -139,7 +138,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> { }
 /// # Examples
 ///
 /// ```
-/// # #![feature(std_misc)]
+/// # #![feature(static_mutex)]
 /// use std::sync::{StaticMutex, MUTEX_INIT};
 ///
 /// static LOCK: StaticMutex = MUTEX_INIT;
@@ -150,7 +149,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> { }
 /// }
 /// // lock is unlocked here.
 /// ```
-#[unstable(feature = "std_misc",
+#[unstable(feature = "static_mutex",
            reason = "may be merged with Mutex in the future")]
 pub struct StaticMutex {
     lock: sys::Mutex,
@@ -176,7 +175,7 @@ impl<'a, T: ?Sized> !marker::Send for MutexGuard<'a, T> {}
 
 /// Static initialization of a mutex. This constant can be used to initialize
 /// other mutex constants.
-#[unstable(feature = "std_misc",
+#[unstable(feature = "static_mutex",
            reason = "may be merged with Mutex in the future")]
 pub const MUTEX_INIT: StaticMutex = StaticMutex::new();
 
@@ -237,7 +236,7 @@ impl<T: ?Sized> Mutex<T> {
     /// time.  You should not trust a `false` value for program correctness
     /// without additional synchronization.
     #[inline]
-    #[unstable(feature = "std_misc")]
+    #[unstable(feature = "sync_poison")]
     pub fn is_poisoned(&self) -> bool {
         self.inner.poison.get()
     }
@@ -270,10 +269,10 @@ struct Dummy(UnsafeCell<()>);
 unsafe impl Sync for Dummy {}
 static DUMMY: Dummy = Dummy(UnsafeCell::new(()));
 
+#[unstable(feature = "static_mutex",
+           reason = "may be merged with Mutex in the future")]
 impl StaticMutex {
     /// Creates a new mutex in an unlocked state ready for use.
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with Mutex in the future")]
     pub const fn new() -> StaticMutex {
         StaticMutex {
             lock: sys::Mutex::new(),
@@ -283,8 +282,6 @@ impl StaticMutex {
 
     /// Acquires this lock, see `Mutex::lock`
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with Mutex in the future")]
     pub fn lock(&'static self) -> LockResult<MutexGuard<()>> {
         unsafe { self.lock.lock() }
         MutexGuard::new(self, &DUMMY.0)
@@ -292,8 +289,6 @@ impl StaticMutex {
 
     /// Attempts to grab this lock, see `Mutex::try_lock`
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with Mutex in the future")]
     pub fn try_lock(&'static self) -> TryLockResult<MutexGuard<()>> {
         if unsafe { self.lock.try_lock() } {
             Ok(try!(MutexGuard::new(self, &DUMMY.0)))
@@ -312,8 +307,6 @@ impl StaticMutex {
     /// *all* platforms. It may be the case that some platforms do not leak
     /// memory if this method is not called, but this is not guaranteed to be
     /// true on all platforms.
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with Mutex in the future")]
     pub unsafe fn destroy(&'static self) {
         self.lock.destroy()
     }
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 269affff208..1e0aa271b4d 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -48,7 +48,7 @@ pub const ONCE_INIT: Once = Once::new();
 
 impl Once {
     /// Creates a new `Once` value.
-    #[unstable(feature = "std_misc")]
+    #[unstable(feature = "once_new")]
     pub const fn new() -> Once {
         Once {
             mutex: StaticMutex::new(),
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index 857d8889b7c..5a6bf987fd7 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -81,7 +81,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
 /// # Examples
 ///
 /// ```
-/// # #![feature(std_misc)]
+/// # #![feature(static_rwlock)]
 /// use std::sync::{StaticRwLock, RW_LOCK_INIT};
 ///
 /// static LOCK: StaticRwLock = RW_LOCK_INIT;
@@ -96,7 +96,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
 /// }
 /// unsafe { LOCK.destroy() } // free all resources
 /// ```
-#[unstable(feature = "std_misc",
+#[unstable(feature = "static_rwlock",
            reason = "may be merged with RwLock in the future")]
 pub struct StaticRwLock {
     lock: sys::RWLock,
@@ -104,7 +104,7 @@ pub struct StaticRwLock {
 }
 
 /// Constant initialization for a statically-initialized rwlock.
-#[unstable(feature = "std_misc",
+#[unstable(feature = "static_rwlock",
            reason = "may be merged with RwLock in the future")]
 pub const RW_LOCK_INIT: StaticRwLock = StaticRwLock::new();
 
@@ -253,7 +253,7 @@ impl<T: ?Sized> RwLock<T> {
     /// time.  You should not trust a `false` value for program correctness
     /// without additional synchronization.
     #[inline]
-    #[unstable(feature = "std_misc")]
+    #[unstable(feature = "sync_poison")]
     pub fn is_poisoned(&self) -> bool {
         self.inner.poison.get()
     }
@@ -283,10 +283,10 @@ struct Dummy(UnsafeCell<()>);
 unsafe impl Sync for Dummy {}
 static DUMMY: Dummy = Dummy(UnsafeCell::new(()));
 
+#[unstable(feature = "static_rwlock",
+           reason = "may be merged with RwLock in the future")]
 impl StaticRwLock {
     /// Creates a new rwlock.
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub const fn new() -> StaticRwLock {
         StaticRwLock {
             lock: sys::RWLock::new(),
@@ -299,8 +299,6 @@ impl StaticRwLock {
     ///
     /// See `RwLock::read`.
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub fn read(&'static self) -> LockResult<RwLockReadGuard<'static, ()>> {
         unsafe { self.lock.read() }
         RwLockReadGuard::new(self, &DUMMY.0)
@@ -310,8 +308,6 @@ impl StaticRwLock {
     ///
     /// See `RwLock::try_read`.
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub fn try_read(&'static self)
                     -> TryLockResult<RwLockReadGuard<'static, ()>> {
         if unsafe { self.lock.try_read() } {
@@ -326,8 +322,6 @@ impl StaticRwLock {
     ///
     /// See `RwLock::write`.
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub fn write(&'static self) -> LockResult<RwLockWriteGuard<'static, ()>> {
         unsafe { self.lock.write() }
         RwLockWriteGuard::new(self, &DUMMY.0)
@@ -337,8 +331,6 @@ impl StaticRwLock {
     ///
     /// See `RwLock::try_write`.
     #[inline]
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub fn try_write(&'static self)
                      -> TryLockResult<RwLockWriteGuard<'static, ()>> {
         if unsafe { self.lock.try_write() } {
@@ -354,8 +346,6 @@ impl StaticRwLock {
     /// active users of the lock, and this also doesn't prevent any future users
     /// of this lock. This method is required to be called to not leak memory on
     /// all platforms.
-    #[unstable(feature = "std_misc",
-               reason = "may be merged with RwLock in the future")]
     pub unsafe fn destroy(&'static self) {
         self.lock.destroy()
     }
diff --git a/src/libstd/sync/semaphore.rs b/src/libstd/sync/semaphore.rs
index 776b3c5064c..0278a6c95b9 100644
--- a/src/libstd/sync/semaphore.rs
+++ b/src/libstd/sync/semaphore.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![unstable(feature = "std_misc",
+#![unstable(feature = "semaphore",
             reason = "the interaction between semaphores and the acquisition/release \
                       of resources is currently unclear")]