39
39
//! atomically-reference-counted shared pointer).
40
40
//!
41
41
//! [`Sync`]: ../../marker/trait.Sync.html
42
- //! [arc]: ../struct.Arc.html
42
+ //! [arc]: ../../../std/sync/ struct.Arc.html
43
43
//!
44
44
//! Most atomic types may be stored in static variables, initialized using
45
45
//! the provided static initializers like [`ATOMIC_BOOL_INIT`]. Atomic statics
@@ -158,27 +158,32 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
158
158
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
159
159
#[ derive( Copy , Clone , Debug ) ]
160
160
pub enum Ordering {
161
- /// No ordering constraints, only atomic operations. Corresponds to LLVM's
162
- /// [`Monotonic`][1] ordering.
163
- /// [1]: http://llvm.org/docs/Atomics.html#monotonic
161
+ /// No ordering constraints, only atomic operations.
162
+ ///
163
+ /// Corresponds to LLVM's [`Monotonic`] ordering.
164
+ ///
165
+ /// [`Monotonic`]: http://llvm.org/docs/Atomics.html#monotonic
164
166
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
165
167
Relaxed ,
166
168
/// When coupled with a store, all previous writes become visible
167
- /// to the other threads that perform a load with [`Acquire`][1] ordering
169
+ /// to the other threads that perform a load with [`Acquire`] ordering
168
170
/// on the same value.
169
- /// [1]: http://llvm.org/docs/Atomics.html#acquire
171
+ ///
172
+ /// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
170
173
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
171
174
Release ,
172
175
/// When coupled with a load, all subsequent loads will see data
173
- /// written before a store with [`Release`][1] ordering on the same value
176
+ /// written before a store with [`Release`] ordering on the same value
174
177
/// in other threads.
175
- /// [1]: http://llvm.org/docs/Atomics.html#release
178
+ ///
179
+ /// [`Release`]: http://llvm.org/docs/Atomics.html#release
176
180
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
177
181
Acquire ,
178
- /// When coupled with a load, uses [`Acquire`][1] ordering, and with a store
179
- /// [`Release`][2] ordering.
180
- /// [1]: http://llvm.org/docs/Atomics.html#acquire
181
- /// [2]: http://llvm.org/docs/Atomics.html#release
182
+ /// When coupled with a load, uses [`Acquire`] ordering, and with a store
183
+ /// [`Release`] ordering.
184
+ ///
185
+ /// [`Acquire`]: http://llvm.org/docs/Atomics.html#acquire
186
+ /// [`Release`]: http://llvm.org/docs/Atomics.html#release
182
187
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
183
188
AcqRel ,
184
189
/// Like `AcqRel` with the additional guarantee that all threads see all
@@ -192,6 +197,7 @@ pub enum Ordering {
192
197
}
193
198
194
199
/// An [`AtomicBool`] initialized to `false`.
200
+ ///
195
201
/// [`AtomicBool`]: struct.AtomicBool.html
196
202
#[ cfg( target_has_atomic = "8" ) ]
197
203
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -257,7 +263,7 @@ impl AtomicBool {
257
263
258
264
/// Loads a value from the bool.
259
265
///
260
- /// `load() ` takes an [`Ordering`] argument which describes the memory ordering
266
+ /// `load` takes an [`Ordering`] argument which describes the memory ordering
261
267
/// of this operation.
262
268
///
263
269
/// # Panics
@@ -285,7 +291,7 @@ impl AtomicBool {
285
291
286
292
/// Stores a value into the bool.
287
293
///
288
- /// `store() ` takes an [`Ordering`] argument which describes the memory ordering
294
+ /// `store` takes an [`Ordering`] argument which describes the memory ordering
289
295
/// of this operation.
290
296
///
291
297
/// [`Ordering`]: enum.Ordering.html
@@ -317,7 +323,7 @@ impl AtomicBool {
317
323
318
324
/// Stores a value into the bool, returning the old value.
319
325
///
320
- /// `swap() ` takes an [`Ordering`] argument which describes the memory ordering
326
+ /// `swap` takes an [`Ordering`] argument which describes the memory ordering
321
327
/// of this operation.
322
328
///
323
329
/// [`Ordering`]: enum.Ordering.html
@@ -343,7 +349,7 @@ impl AtomicBool {
343
349
/// The return value is always the previous value. If it is equal to `current`, then the value
344
350
/// was updated.
345
351
///
346
- /// `compare_and_swap() ` also takes an [`Ordering`] argument which describes the memory
352
+ /// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
347
353
/// ordering of this operation.
348
354
///
349
355
/// [`Ordering`]: enum.Ordering.html
@@ -375,7 +381,7 @@ impl AtomicBool {
375
381
/// The return value is a result indicating whether the new value was written and containing
376
382
/// the previous value. On success this value is guaranteed to be equal to `current`.
377
383
///
378
- /// `compare_exchange() ` takes two [`Ordering`] arguments to describe the memory
384
+ /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
379
385
/// ordering of this operation. The first describes the required ordering if the
380
386
/// operation succeeds while the second describes the required ordering when the
381
387
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and must
@@ -423,18 +429,18 @@ impl AtomicBool {
423
429
424
430
/// Stores a value into the `bool` if the current value is the same as the `current` value.
425
431
///
426
- /// Unlike [`compare_exchange() `], this function is allowed to spuriously fail even when the
432
+ /// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
427
433
/// comparison succeeds, which can result in more efficient code on some platforms. The
428
434
/// return value is a result indicating whether the new value was written and containing the
429
435
/// previous value.
430
436
///
431
- /// `compare_exchange_weak() ` takes two [`Ordering`] arguments to describe the memory
437
+ /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
432
438
/// ordering of this operation. The first describes the required ordering if the operation
433
439
/// succeeds while the second describes the required ordering when the operation fails. The
434
440
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
435
441
/// weaker than the success ordering.
436
442
///
437
- /// [`compare_exchange() `]: #method.compare_exchange
443
+ /// [`compare_exchange`]: #method.compare_exchange
438
444
/// [`Ordering`]: enum.Ordering.html
439
445
/// [`Release`]: enum.Ordering.html#variant.Release
440
446
/// [`AcqRel`]: enum.Ordering.html#variant.Release
@@ -665,7 +671,7 @@ impl<T> AtomicPtr<T> {
665
671
666
672
/// Loads a value from the pointer.
667
673
///
668
- /// `load() ` takes an [`Ordering`] argument which describes the memory ordering
674
+ /// `load` takes an [`Ordering`] argument which describes the memory ordering
669
675
/// of this operation.
670
676
///
671
677
/// # Panics
@@ -694,7 +700,7 @@ impl<T> AtomicPtr<T> {
694
700
695
701
/// Stores a value into the pointer.
696
702
///
697
- /// `store() ` takes an [`Ordering`] argument which describes the memory ordering
703
+ /// `store` takes an [`Ordering`] argument which describes the memory ordering
698
704
/// of this operation.
699
705
///
700
706
/// [`Ordering`]: enum.Ordering.html
@@ -718,7 +724,6 @@ impl<T> AtomicPtr<T> {
718
724
///
719
725
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
720
726
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
721
- ///
722
727
#[ inline]
723
728
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
724
729
pub fn store ( & self , ptr : * mut T , order : Ordering ) {
@@ -729,7 +734,7 @@ impl<T> AtomicPtr<T> {
729
734
730
735
/// Stores a value into the pointer, returning the old value.
731
736
///
732
- /// `swap() ` takes an [`Ordering`] argument which describes the memory ordering
737
+ /// `swap` takes an [`Ordering`] argument which describes the memory ordering
733
738
/// of this operation.
734
739
///
735
740
/// [`Ordering`]: enum.Ordering.html
@@ -757,7 +762,7 @@ impl<T> AtomicPtr<T> {
757
762
/// The return value is always the previous value. If it is equal to `current`, then the value
758
763
/// was updated.
759
764
///
760
- /// `compare_and_swap() ` also takes an [`Ordering`] argument which describes the memory
765
+ /// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
761
766
/// ordering of this operation.
762
767
///
763
768
/// [`Ordering`]: enum.Ordering.html
@@ -789,7 +794,7 @@ impl<T> AtomicPtr<T> {
789
794
/// The return value is a result indicating whether the new value was written and containing
790
795
/// the previous value. On success this value is guaranteed to be equal to `current`.
791
796
///
792
- /// `compare_exchange() ` takes two [`Ordering`] arguments to describe the memory
797
+ /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
793
798
/// ordering of this operation. The first describes the required ordering if
794
799
/// the operation succeeds while the second describes the required ordering when
795
800
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`]
@@ -836,18 +841,18 @@ impl<T> AtomicPtr<T> {
836
841
837
842
/// Stores a value into the pointer if the current value is the same as the `current` value.
838
843
///
839
- /// Unlike [`compare_exchange() `], this function is allowed to spuriously fail even when the
844
+ /// Unlike [`compare_exchange`], this function is allowed to spuriously fail even when the
840
845
/// comparison succeeds, which can result in more efficient code on some platforms. The
841
846
/// return value is a result indicating whether the new value was written and containing the
842
847
/// previous value.
843
848
///
844
- /// `compare_exchange_weak() ` takes two [`Ordering`] arguments to describe the memory
849
+ /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
845
850
/// ordering of this operation. The first describes the required ordering if the operation
846
851
/// succeeds while the second describes the required ordering when the operation fails. The
847
852
/// failure ordering can't be [`Release`] or [`AcqRel`] and must be equivalent or
848
853
/// weaker than the success ordering.
849
854
///
850
- /// [`compare_exchange() `]: #method.compare_exchange
855
+ /// [`compare_exchange`]: #method.compare_exchange
851
856
/// [`Ordering`]: enum.Ordering.html
852
857
/// [`Release`]: enum.Ordering.html#variant.Release
853
858
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
@@ -986,7 +991,7 @@ macro_rules! atomic_int {
986
991
987
992
/// Loads a value from the atomic integer.
988
993
///
989
- /// `load() ` takes an [`Ordering`] argument which describes the memory ordering of this
994
+ /// `load` takes an [`Ordering`] argument which describes the memory ordering of this
990
995
/// operation.
991
996
///
992
997
/// # Panics
@@ -1014,7 +1019,7 @@ macro_rules! atomic_int {
1014
1019
1015
1020
/// Stores a value into the atomic integer.
1016
1021
///
1017
- /// `store() ` takes an [`Ordering`] argument which describes the memory ordering of this
1022
+ /// `store` takes an [`Ordering`] argument which describes the memory ordering of this
1018
1023
/// operation.
1019
1024
///
1020
1025
/// [`Ordering`]: enum.Ordering.html
@@ -1036,7 +1041,6 @@ macro_rules! atomic_int {
1036
1041
///
1037
1042
/// [`Acquire`]: enum.Ordering.html#variant.Acquire
1038
1043
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
1039
- ///
1040
1044
#[ inline]
1041
1045
#[ $stable]
1042
1046
pub fn store( & self , val: $int_type, order: Ordering ) {
@@ -1045,7 +1049,7 @@ macro_rules! atomic_int {
1045
1049
1046
1050
/// Stores a value into the atomic integer, returning the old value.
1047
1051
///
1048
- /// `swap() ` takes an [`Ordering`] argument which describes the memory ordering of this
1052
+ /// `swap` takes an [`Ordering`] argument which describes the memory ordering of this
1049
1053
/// operation.
1050
1054
///
1051
1055
/// [`Ordering`]: enum.Ordering.html
@@ -1071,7 +1075,7 @@ macro_rules! atomic_int {
1071
1075
/// The return value is always the previous value. If it is equal to `current`, then the
1072
1076
/// value was updated.
1073
1077
///
1074
- /// `compare_and_swap() ` also takes an [`Ordering`] argument which describes the memory
1078
+ /// `compare_and_swap` also takes an [`Ordering`] argument which describes the memory
1075
1079
/// ordering of this operation.
1076
1080
///
1077
1081
/// [`Ordering`]: enum.Ordering.html
@@ -1111,7 +1115,7 @@ macro_rules! atomic_int {
1111
1115
/// containing the previous value. On success this value is guaranteed to be equal to
1112
1116
/// `current`.
1113
1117
///
1114
- /// `compare_exchange() ` takes two [`Ordering`] arguments to describe the memory
1118
+ /// `compare_exchange` takes two [`Ordering`] arguments to describe the memory
1115
1119
/// ordering of this operation. The first describes the required ordering if
1116
1120
/// the operation succeeds while the second describes the required ordering when
1117
1121
/// the operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
@@ -1153,18 +1157,18 @@ macro_rules! atomic_int {
1153
1157
/// Stores a value into the atomic integer if the current value is the same as the
1154
1158
/// `current` value.
1155
1159
///
1156
- /// Unlike [`compare_exchange() `], this function is allowed to spuriously fail even
1160
+ /// Unlike [`compare_exchange`], this function is allowed to spuriously fail even
1157
1161
/// when the comparison succeeds, which can result in more efficient code on some
1158
1162
/// platforms. The return value is a result indicating whether the new value was
1159
1163
/// written and containing the previous value.
1160
1164
///
1161
- /// `compare_exchange_weak() ` takes two [`Ordering`] arguments to describe the memory
1165
+ /// `compare_exchange_weak` takes two [`Ordering`] arguments to describe the memory
1162
1166
/// ordering of this operation. The first describes the required ordering if the
1163
1167
/// operation succeeds while the second describes the required ordering when the
1164
1168
/// operation fails. The failure ordering can't be [`Release`] or [`AcqRel`] and
1165
1169
/// must be equivalent or weaker than the success ordering.
1166
1170
///
1167
- /// [`compare_exchange() `]: #method.compare_exchange
1171
+ /// [`compare_exchange`]: #method.compare_exchange
1168
1172
/// [`Ordering`]: enum.Ordering.html
1169
1173
/// [`Release`]: enum.Ordering.html#variant.Release
1170
1174
/// [`AcqRel`]: enum.Ordering.html#variant.AcqRel
0 commit comments