@@ -86,15 +86,15 @@ pub struct AtomicBool {
86
86
unsafe impl Sync for AtomicBool { }
87
87
88
88
/// A signed integer type which can be safely shared between threads.
89
- #[ stable ]
89
+ #[ unstable = "awaiting int/uint conventions, may be renamed" ]
90
90
pub struct AtomicInt {
91
91
v : UnsafeCell < int > ,
92
92
}
93
93
94
94
unsafe impl Sync for AtomicInt { }
95
95
96
96
/// An unsigned integer type which can be safely shared between threads.
97
- #[ stable ]
97
+ #[ unstable = "awaiting int/uint conventions, may be renamed" ]
98
98
pub struct AtomicUint {
99
99
v : UnsafeCell < uint > ,
100
100
}
@@ -146,28 +146,18 @@ pub enum Ordering {
146
146
}
147
147
148
148
/// An `AtomicBool` initialized to `false`.
149
- #[ unstable = "may be renamed, pending conventions for static initalizers" ]
149
+ #[ stable ]
150
150
pub const ATOMIC_BOOL_INIT : AtomicBool =
151
151
AtomicBool { v : UnsafeCell { value : 0 } } ;
152
152
/// An `AtomicInt` initialized to `0`.
153
- #[ unstable = "may be renamed, pending conventions for static initalizers " ]
153
+ #[ unstable = "awaiting int/uint conventions, may be renamed " ]
154
154
pub const ATOMIC_INT_INIT : AtomicInt =
155
155
AtomicInt { v : UnsafeCell { value : 0 } } ;
156
156
/// An `AtomicUint` initialized to `0`.
157
- #[ unstable = "may be renamed, pending conventions for static initalizers " ]
157
+ #[ unstable = "awaiting int/uint conventions, may be renamed " ]
158
158
pub const ATOMIC_UINT_INIT : AtomicUint =
159
159
AtomicUint { v : UnsafeCell { value : 0 , } } ;
160
160
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
-
171
161
// NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
172
162
const UINT_TRUE : uint = -1 ;
173
163
@@ -413,6 +403,7 @@ impl AtomicBool {
413
403
}
414
404
}
415
405
406
+ #[ unstable = "awaiting int/uint conventions, types may change" ]
416
407
impl AtomicInt {
417
408
/// Creates a new `AtomicInt`.
418
409
///
@@ -424,7 +415,6 @@ impl AtomicInt {
424
415
/// let atomic_forty_two = AtomicInt::new(42);
425
416
/// ```
426
417
#[ inline]
427
- #[ stable]
428
418
pub fn new ( v : int ) -> AtomicInt {
429
419
AtomicInt { v : UnsafeCell :: new ( v) }
430
420
}
@@ -447,7 +437,6 @@ impl AtomicInt {
447
437
/// let value = some_int.load(Ordering::Relaxed);
448
438
/// ```
449
439
#[ inline]
450
- #[ stable]
451
440
pub fn load ( & self , order : Ordering ) -> int {
452
441
unsafe { atomic_load ( self . v . get ( ) as * const int , order) }
453
442
}
@@ -470,7 +459,6 @@ impl AtomicInt {
470
459
///
471
460
/// Panics if `order` is `Acquire` or `AcqRel`.
472
461
#[ inline]
473
- #[ stable]
474
462
pub fn store ( & self , val : int , order : Ordering ) {
475
463
unsafe { atomic_store ( self . v . get ( ) , val, order) ; }
476
464
}
@@ -489,7 +477,6 @@ impl AtomicInt {
489
477
/// let value = some_int.swap(10, Ordering::Relaxed);
490
478
/// ```
491
479
#[ inline]
492
- #[ stable]
493
480
pub fn swap ( & self , val : int , order : Ordering ) -> int {
494
481
unsafe { atomic_swap ( self . v . get ( ) , val, order) }
495
482
}
@@ -511,7 +498,6 @@ impl AtomicInt {
511
498
/// let value = some_int.compare_and_swap(5, 10, Ordering::Relaxed);
512
499
/// ```
513
500
#[ inline]
514
- #[ stable]
515
501
pub fn compare_and_swap ( & self , old : int , new : int , order : Ordering ) -> int {
516
502
unsafe { atomic_compare_and_swap ( self . v . get ( ) , old, new, order) }
517
503
}
@@ -528,7 +514,6 @@ impl AtomicInt {
528
514
/// assert_eq!(10, foo.load(Ordering::SeqCst));
529
515
/// ```
530
516
#[ inline]
531
- #[ stable]
532
517
pub fn fetch_add ( & self , val : int , order : Ordering ) -> int {
533
518
unsafe { atomic_add ( self . v . get ( ) , val, order) }
534
519
}
@@ -545,7 +530,6 @@ impl AtomicInt {
545
530
/// assert_eq!(-10, foo.load(Ordering::SeqCst));
546
531
/// ```
547
532
#[ inline]
548
- #[ stable]
549
533
pub fn fetch_sub ( & self , val : int , order : Ordering ) -> int {
550
534
unsafe { atomic_sub ( self . v . get ( ) , val, order) }
551
535
}
@@ -561,7 +545,6 @@ impl AtomicInt {
561
545
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
562
546
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
563
547
#[ inline]
564
- #[ stable]
565
548
pub fn fetch_and ( & self , val : int , order : Ordering ) -> int {
566
549
unsafe { atomic_and ( self . v . get ( ) , val, order) }
567
550
}
@@ -577,7 +560,6 @@ impl AtomicInt {
577
560
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
578
561
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
579
562
#[ inline]
580
- #[ stable]
581
563
pub fn fetch_or ( & self , val : int , order : Ordering ) -> int {
582
564
unsafe { atomic_or ( self . v . get ( ) , val, order) }
583
565
}
@@ -593,12 +575,12 @@ impl AtomicInt {
593
575
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
594
576
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
595
577
#[ inline]
596
- #[ stable]
597
578
pub fn fetch_xor ( & self , val : int , order : Ordering ) -> int {
598
579
unsafe { atomic_xor ( self . v . get ( ) , val, order) }
599
580
}
600
581
}
601
582
583
+ #[ unstable = "awaiting int/uint conventions, types may change" ]
602
584
impl AtomicUint {
603
585
/// Creates a new `AtomicUint`.
604
586
///
@@ -610,7 +592,6 @@ impl AtomicUint {
610
592
/// let atomic_forty_two = AtomicUint::new(42u);
611
593
/// ```
612
594
#[ inline]
613
- #[ stable]
614
595
pub fn new ( v : uint ) -> AtomicUint {
615
596
AtomicUint { v : UnsafeCell :: new ( v) }
616
597
}
@@ -633,7 +614,6 @@ impl AtomicUint {
633
614
/// let value = some_uint.load(Ordering::Relaxed);
634
615
/// ```
635
616
#[ inline]
636
- #[ stable]
637
617
pub fn load ( & self , order : Ordering ) -> uint {
638
618
unsafe { atomic_load ( self . v . get ( ) as * const uint , order) }
639
619
}
@@ -656,7 +636,6 @@ impl AtomicUint {
656
636
///
657
637
/// Panics if `order` is `Acquire` or `AcqRel`.
658
638
#[ inline]
659
- #[ stable]
660
639
pub fn store ( & self , val : uint , order : Ordering ) {
661
640
unsafe { atomic_store ( self . v . get ( ) , val, order) ; }
662
641
}
@@ -675,7 +654,6 @@ impl AtomicUint {
675
654
/// let value = some_uint.swap(10, Ordering::Relaxed);
676
655
/// ```
677
656
#[ inline]
678
- #[ stable]
679
657
pub fn swap ( & self , val : uint , order : Ordering ) -> uint {
680
658
unsafe { atomic_swap ( self . v . get ( ) , val, order) }
681
659
}
@@ -697,7 +675,6 @@ impl AtomicUint {
697
675
/// let value = some_uint.compare_and_swap(5, 10, Ordering::Relaxed);
698
676
/// ```
699
677
#[ inline]
700
- #[ stable]
701
678
pub fn compare_and_swap ( & self , old : uint , new : uint , order : Ordering ) -> uint {
702
679
unsafe { atomic_compare_and_swap ( self . v . get ( ) , old, new, order) }
703
680
}
@@ -714,7 +691,6 @@ impl AtomicUint {
714
691
/// assert_eq!(10, foo.load(Ordering::SeqCst));
715
692
/// ```
716
693
#[ inline]
717
- #[ stable]
718
694
pub fn fetch_add ( & self , val : uint , order : Ordering ) -> uint {
719
695
unsafe { atomic_add ( self . v . get ( ) , val, order) }
720
696
}
@@ -731,7 +707,6 @@ impl AtomicUint {
731
707
/// assert_eq!(0, foo.load(Ordering::SeqCst));
732
708
/// ```
733
709
#[ inline]
734
- #[ stable]
735
710
pub fn fetch_sub ( & self , val : uint , order : Ordering ) -> uint {
736
711
unsafe { atomic_sub ( self . v . get ( ) , val, order) }
737
712
}
@@ -747,7 +722,6 @@ impl AtomicUint {
747
722
/// assert_eq!(0b101101, foo.fetch_and(0b110011, Ordering::SeqCst));
748
723
/// assert_eq!(0b100001, foo.load(Ordering::SeqCst));
749
724
#[ inline]
750
- #[ stable]
751
725
pub fn fetch_and ( & self , val : uint , order : Ordering ) -> uint {
752
726
unsafe { atomic_and ( self . v . get ( ) , val, order) }
753
727
}
@@ -763,7 +737,6 @@ impl AtomicUint {
763
737
/// assert_eq!(0b101101, foo.fetch_or(0b110011, Ordering::SeqCst));
764
738
/// assert_eq!(0b111111, foo.load(Ordering::SeqCst));
765
739
#[ inline]
766
- #[ stable]
767
740
pub fn fetch_or ( & self , val : uint , order : Ordering ) -> uint {
768
741
unsafe { atomic_or ( self . v . get ( ) , val, order) }
769
742
}
@@ -779,7 +752,6 @@ impl AtomicUint {
779
752
/// assert_eq!(0b101101, foo.fetch_xor(0b110011, Ordering::SeqCst));
780
753
/// assert_eq!(0b011110, foo.load(Ordering::SeqCst));
781
754
#[ inline]
782
- #[ stable]
783
755
pub fn fetch_xor ( & self , val : uint , order : Ordering ) -> uint {
784
756
unsafe { atomic_xor ( self . v . get ( ) , val, order) }
785
757
}
0 commit comments