@@ -86,15 +86,15 @@ pub struct AtomicBool {
8686unsafe impl Sync for AtomicBool { }
8787
8888/// A signed integer type which can be safely shared between threads.
89- #[ stable ]
89+ #[ unstable = "awaiting int/uint conventions, may be renamed" ]
9090pub struct AtomicInt {
9191 v : UnsafeCell < int > ,
9292}
9393
9494unsafe impl Sync for AtomicInt { }
9595
9696/// An unsigned integer type which can be safely shared between threads.
97- #[ stable ]
97+ #[ unstable = "awaiting int/uint conventions, may be renamed" ]
9898pub struct AtomicUint {
9999 v : UnsafeCell < uint > ,
100100}
@@ -146,28 +146,18 @@ pub enum Ordering {
146146}
147147
148148/// An `AtomicBool` initialized to `false`.
149- #[ unstable = "may be renamed, pending conventions for static initalizers" ]
149+ #[ stable ]
150150pub const ATOMIC_BOOL_INIT : AtomicBool =
151151 AtomicBool { v : UnsafeCell { value : 0 } } ;
152152/// An `AtomicInt` initialized to `0`.
153- #[ unstable = "may be renamed, pending conventions for static initalizers " ]
153+ #[ unstable = "awaiting int/uint conventions, may be renamed " ]
154154pub const ATOMIC_INT_INIT : AtomicInt =
155155 AtomicInt { v : UnsafeCell { value : 0 } } ;
156156/// An `AtomicUint` initialized to `0`.
157- #[ unstable = "may be renamed, pending conventions for static initalizers " ]
157+ #[ unstable = "awaiting int/uint conventions, may be renamed " ]
158158pub const ATOMIC_UINT_INIT : AtomicUint =
159159 AtomicUint { v : UnsafeCell { value : 0 , } } ;
160160
161- /// Deprecated
162- #[ deprecated = "renamed to ATOMIC_BOOL_INIT" ]
163- pub const INIT_ATOMIC_BOOL : AtomicBool = ATOMIC_BOOL_INIT ;
164- /// Deprecated
165- #[ deprecated = "renamed to ATOMIC_INT_INIT" ]
166- pub const INIT_ATOMIC_INT : AtomicInt = ATOMIC_INT_INIT ;
167- /// Deprecated
168- #[ deprecated = "renamed to ATOMIC_UINT_INIT" ]
169- pub const INIT_ATOMIC_UINT : AtomicUint = ATOMIC_UINT_INIT ;
170-
171161// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
172162const UINT_TRUE : uint = -1 ;
173163
@@ -413,6 +403,7 @@ impl AtomicBool {
413403 }
414404}
415405
406+ #[ unstable = "awaiting int/uint conventions, types may change" ]
416407impl AtomicInt {
417408 /// Creates a new `AtomicInt`.
418409 ///
@@ -424,7 +415,6 @@ impl AtomicInt {
424415 /// let atomic_forty_two = AtomicInt::new(42);
425416 /// ```
426417 #[ inline]
427- #[ stable]
428418 pub fn new ( v : int ) -> AtomicInt {
429419 AtomicInt { v : UnsafeCell :: new ( v) }
430420 }
@@ -447,7 +437,6 @@ impl AtomicInt {
447437 /// let value = some_int.load(Ordering::Relaxed);
448438 /// ```
449439 #[ inline]
450- #[ stable]
451440 pub fn load ( & self , order : Ordering ) -> int {
452441 unsafe { atomic_load ( self . v . get ( ) as * const int , order) }
453442 }
@@ -470,7 +459,6 @@ impl AtomicInt {
470459 ///
471460 /// Panics if `order` is `Acquire` or `AcqRel`.
472461 #[ inline]
473- #[ stable]
474462 pub fn store ( & self , val : int , order : Ordering ) {
475463 unsafe { atomic_store ( self . v . get ( ) , val, order) ; }
476464 }
@@ -489,7 +477,6 @@ impl AtomicInt {
489477 /// let value = some_int.swap(10, Ordering::Relaxed);
490478 /// ```
491479 #[ inline]
492- #[ stable]
493480 pub fn swap ( & self , val : int , order : Ordering ) -> int {
494481 unsafe { atomic_swap ( self . v . get ( ) , val, order) }
495482 }
@@ -511,7 +498,6 @@ impl AtomicInt {
511498 /// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
512499 /// ```
513500 #[ inline]
514- #[ stable]
515501 pub fn compare_and_swap ( & self , old : int , new : int , order : Ordering ) -> int {
516502 unsafe { atomic_compare_and_swap ( self . v . get ( ) , old, new, order) }
517503 }
@@ -528,7 +514,6 @@ impl AtomicInt {
528514 /// assert_eq!(10, foo.load(Ordering::SeqCst));
529515 /// ```
530516 #[ inline]
531- #[ stable]
532517 pub fn fetch_add ( & self , val : int , order : Ordering ) -> int {
533518 unsafe { atomic_add ( self . v . get ( ) , val, order) }
534519 }
@@ -545,7 +530,6 @@ impl AtomicInt {
545530 /// assert_eq!(-10, foo.load(Ordering::SeqCst));
546531 /// ```
547532 #[ inline]
548- #[ stable]
549533 pub fn fetch_sub ( & self , val : int , order : Ordering ) -> int {
550534 unsafe { atomic_sub ( self . v . get ( ) , val, order) }
551535 }
@@ -561,7 +545,6 @@ impl AtomicInt {
561545 /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
562546 /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
563547 #[ inline]
564- #[ stable]
565548 pub fn fetch_and ( & self , val : int , order : Ordering ) -> int {
566549 unsafe { atomic_and ( self . v . get ( ) , val, order) }
567550 }
@@ -577,7 +560,6 @@ impl AtomicInt {
577560 /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
578561 /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
579562 #[ inline]
580- #[ stable]
581563 pub fn fetch_or ( & self , val : int , order : Ordering ) -> int {
582564 unsafe { atomic_or ( self . v . get ( ) , val, order) }
583565 }
@@ -593,12 +575,12 @@ impl AtomicInt {
593575 /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
594576 /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
595577 #[ inline]
596- #[ stable]
597578 pub fn fetch_xor ( & self , val : int , order : Ordering ) -> int {
598579 unsafe { atomic_xor ( self . v . get ( ) , val, order) }
599580 }
600581}
601582
583+ #[ unstable = "awaiting int/uint conventions, types may change" ]
602584impl AtomicUint {
603585 /// Creates a new `AtomicUint`.
604586 ///
@@ -610,7 +592,6 @@ impl AtomicUint {
610592 /// let atomic_forty_two = AtomicUint::new(42u);
611593 /// ```
612594 #[ inline]
613- #[ stable]
614595 pub fn new ( v : uint ) -> AtomicUint {
615596 AtomicUint { v : UnsafeCell :: new ( v) }
616597 }
@@ -633,7 +614,6 @@ impl AtomicUint {
633614 /// let value = some_uint.load(Ordering::Relaxed);
634615 /// ```
635616 #[ inline]
636- #[ stable]
637617 pub fn load ( & self , order : Ordering ) -> uint {
638618 unsafe { atomic_load ( self . v . get ( ) as * const uint , order) }
639619 }
@@ -656,7 +636,6 @@ impl AtomicUint {
656636 ///
657637 /// Panics if `order` is `Acquire` or `AcqRel`.
658638 #[ inline]
659- #[ stable]
660639 pub fn store ( & self , val : uint , order : Ordering ) {
661640 unsafe { atomic_store ( self . v . get ( ) , val, order) ; }
662641 }
@@ -675,7 +654,6 @@ impl AtomicUint {
675654 /// let value = some_uint.swap(10, Ordering::Relaxed);
676655 /// ```
677656 #[ inline]
678- #[ stable]
679657 pub fn swap ( & self , val : uint , order : Ordering ) -> uint {
680658 unsafe { atomic_swap ( self . v . get ( ) , val, order) }
681659 }
@@ -697,7 +675,6 @@ impl AtomicUint {
697675 /// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
698676 /// ```
699677 #[ inline]
700- #[ stable]
701678 pub fn compare_and_swap ( & self , old : uint , new : uint , order : Ordering ) -> uint {
702679 unsafe { atomic_compare_and_swap ( self . v . get ( ) , old, new, order) }
703680 }
@@ -714,7 +691,6 @@ impl AtomicUint {
714691 /// assert_eq!(10, foo.load(Ordering::SeqCst));
715692 /// ```
716693 #[ inline]
717- #[ stable]
718694 pub fn fetch_add ( & self , val : uint , order : Ordering ) -> uint {
719695 unsafe { atomic_add ( self . v . get ( ) , val, order) }
720696 }
@@ -731,7 +707,6 @@ impl AtomicUint {
731707 /// assert_eq!(0, foo.load(Ordering::SeqCst));
732708 /// ```
733709 #[ inline]
734- #[ stable]
735710 pub fn fetch_sub ( & self , val : uint , order : Ordering ) -> uint {
736711 unsafe { atomic_sub ( self . v . get ( ) , val, order) }
737712 }
@@ -747,7 +722,6 @@ impl AtomicUint {
747722 /// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
748723 /// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
749724 #[ inline]
750- #[ stable]
751725 pub fn fetch_and ( & self , val : uint , order : Ordering ) -> uint {
752726 unsafe { atomic_and ( self . v . get ( ) , val, order) }
753727 }
@@ -763,7 +737,6 @@ impl AtomicUint {
763737 /// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
764738 /// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
765739 #[ inline]
766- #[ stable]
767740 pub fn fetch_or ( & self , val : uint , order : Ordering ) -> uint {
768741 unsafe { atomic_or ( self . v . get ( ) , val, order) }
769742 }
@@ -779,7 +752,6 @@ impl AtomicUint {
779752 /// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
780753 /// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
781754 #[ inline]
782- #[ stable]
783755 pub fn fetch_xor ( & self , val : uint , order : Ordering ) -> uint {
784756 unsafe { atomic_xor ( self . v . get ( ) , val, order) }
785757 }
0 commit comments