]> git.lizzy.rs Git - rust.git/commitdiff
std: Move Atomic{Int,Uint} back to unstable
authorAlex Crichton <alex@alexcrichton.com>
Mon, 5 Jan 2015 19:39:52 +0000 (11:39 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 5 Jan 2015 19:39:52 +0000 (11:39 -0800)
The int/uint story is under heavy development, and these types are likely to be
renamed.

src/libcore/atomic.rs

index fbb8f9d8cf754e09f3886701d3af8250c152e564..15c20253c8bc78b1c739b28c14215e9484886455 100644 (file)
@@ -86,7 +86,7 @@ pub struct AtomicBool {
 unsafe impl Sync for AtomicBool {}
 
 /// A signed integer type which can be safely shared between threads.
-#[stable]
+#[unstable = "awaiting int/uint conventions, may be renamed"]
 pub struct AtomicInt {
     v: UnsafeCell<int>,
 }
@@ -94,7 +94,7 @@ pub struct AtomicInt {
 unsafe impl Sync for AtomicInt {}
 
 /// An unsigned integer type which can be safely shared between threads.
-#[stable]
+#[unstable = "awaiting int/uint conventions, may be renamed"]
 pub struct AtomicUint {
     v: UnsafeCell<uint>,
 }
@@ -150,11 +150,11 @@ pub enum Ordering {
 pub const ATOMIC_BOOL_INIT: AtomicBool =
         AtomicBool { v: UnsafeCell { value: 0 } };
 /// An `AtomicInt` initialized to `0`.
-#[stable]
+#[unstable = "awaiting int/uint conventions, may be renamed"]
 pub const ATOMIC_INT_INIT: AtomicInt =
         AtomicInt { v: UnsafeCell { value: 0 } };
 /// An `AtomicUint` initialized to `0`.
-#[stable]
+#[unstable = "awaiting int/uint conventions, may be renamed"]
 pub const ATOMIC_UINT_INIT: AtomicUint =
         AtomicUint { v: UnsafeCell { value: 0, } };
 
@@ -403,6 +403,7 @@ pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
     }
 }
 
+#[unstable = "awaiting int/uint conventions, types may change"]
 impl AtomicInt {
     /// Creates a new `AtomicInt`.
     ///
@@ -414,7 +415,6 @@ impl AtomicInt {
     /// let atomic_forty_two  = AtomicInt::new(42);
     /// ```
     #[inline]
-    #[stable]
     pub fn new(v: int) -> AtomicInt {
         AtomicInt {v: UnsafeCell::new(v)}
     }
@@ -437,7 +437,6 @@ pub fn new(v: int) -> AtomicInt {
     /// let value = some_int.load(Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn load(&self, order: Ordering) -> int {
         unsafe { atomic_load(self.v.get() as *const int, order) }
     }
@@ -460,7 +459,6 @@ pub fn load(&self, order: Ordering) -> int {
     ///
     /// Panics if `order` is `Acquire` or `AcqRel`.
     #[inline]
-    #[stable]
     pub fn store(&self, val: int, order: Ordering) {
         unsafe { atomic_store(self.v.get(), val, order); }
     }
@@ -479,7 +477,6 @@ pub fn store(&self, val: int, order: Ordering) {
     /// let value = some_int.swap(10, Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn swap(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_swap(self.v.get(), val, order) }
     }
@@ -501,7 +498,6 @@ pub fn swap(&self, val: int, order: Ordering) -> int {
     /// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int {
         unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
     }
@@ -518,7 +514,6 @@ pub fn compare_and_swap(&self, old: int, new: int, order: Ordering) -> int {
     /// assert_eq!(10, foo.load(Ordering::SeqCst));
     /// ```
     #[inline]
-    #[stable]
     pub fn fetch_add(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_add(self.v.get(), val, order) }
     }
@@ -535,7 +530,6 @@ pub fn fetch_add(&self, val: int, order: Ordering) -> int {
     /// assert_eq!(-10, foo.load(Ordering::SeqCst));
     /// ```
     #[inline]
-    #[stable]
     pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_sub(self.v.get(), val, order) }
     }
@@ -551,7 +545,6 @@ pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
     /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_and(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_and(self.v.get(), val, order) }
     }
@@ -567,7 +560,6 @@ pub fn fetch_and(&self, val: int, order: Ordering) -> int {
     /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_or(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_or(self.v.get(), val, order) }
     }
@@ -583,12 +575,12 @@ pub fn fetch_or(&self, val: int, order: Ordering) -> int {
     /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
         unsafe { atomic_xor(self.v.get(), val, order) }
     }
 }
 
+#[unstable = "awaiting int/uint conventions, types may change"]
 impl AtomicUint {
     /// Creates a new `AtomicUint`.
     ///
@@ -600,7 +592,6 @@ impl AtomicUint {
     /// let atomic_forty_two = AtomicUint::new(42u);
     /// ```
     #[inline]
-    #[stable]
     pub fn new(v: uint) -> AtomicUint {
         AtomicUint { v: UnsafeCell::new(v) }
     }
@@ -623,7 +614,6 @@ pub fn new(v: uint) -> AtomicUint {
     /// let value = some_uint.load(Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn load(&self, order: Ordering) -> uint {
         unsafe { atomic_load(self.v.get() as *const uint, order) }
     }
@@ -646,7 +636,6 @@ pub fn load(&self, order: Ordering) -> uint {
     ///
     /// Panics if `order` is `Acquire` or `AcqRel`.
     #[inline]
-    #[stable]
     pub fn store(&self, val: uint, order: Ordering) {
         unsafe { atomic_store(self.v.get(), val, order); }
     }
@@ -665,7 +654,6 @@ pub fn store(&self, val: uint, order: Ordering) {
     /// let value = some_uint.swap(10, Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn swap(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_swap(self.v.get(), val, order) }
     }
@@ -687,7 +675,6 @@ pub fn swap(&self, val: uint, order: Ordering) -> uint {
     /// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
     /// ```
     #[inline]
-    #[stable]
     pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint {
         unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) }
     }
@@ -704,7 +691,6 @@ pub fn compare_and_swap(&self, old: uint, new: uint, order: Ordering) -> uint {
     /// assert_eq!(10, foo.load(Ordering::SeqCst));
     /// ```
     #[inline]
-    #[stable]
     pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_add(self.v.get(), val, order) }
     }
@@ -721,7 +707,6 @@ pub fn fetch_add(&self, val: uint, order: Ordering) -> uint {
     /// assert_eq!(0, foo.load(Ordering::SeqCst));
     /// ```
     #[inline]
-    #[stable]
     pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_sub(self.v.get(), val, order) }
     }
@@ -737,7 +722,6 @@ pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
     /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_and(self.v.get(), val, order) }
     }
@@ -753,7 +737,6 @@ pub fn fetch_and(&self, val: uint, order: Ordering) -> uint {
     /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_or(self.v.get(), val, order) }
     }
@@ -769,7 +752,6 @@ pub fn fetch_or(&self, val: uint, order: Ordering) -> uint {
     /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
     /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
     #[inline]
-    #[stable]
     pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
         unsafe { atomic_xor(self.v.get(), val, order) }
     }