@@ -296,7 +296,7 @@ impl AtomicBool {
296
296
}
297
297
}
298
298
299
- /// Stores a value into the bool, returning the old value.
299
+ /// Stores a value into the bool, returning the previous value.
300
300
///
301
301
/// `swap` takes an [`Ordering`] argument which describes the memory ordering
302
302
/// of this operation.
@@ -703,7 +703,7 @@ impl<T> AtomicPtr<T> {
703
703
}
704
704
}
705
705
706
- /// Stores a value into the pointer, returning the old value.
706
+ /// Stores a value into the pointer, returning the previous value.
707
707
///
708
708
/// `swap` takes an [`Ordering`] argument which describes the memory ordering
709
709
/// of this operation.
@@ -1015,7 +1015,7 @@ macro_rules! atomic_int {
1015
1015
unsafe { atomic_store( self . v. get( ) , val, order) ; }
1016
1016
}
1017
1017
1018
- /// Stores a value into the atomic integer, returning the old value.
1018
+ /// Stores a value into the atomic integer, returning the previous value.
1019
1019
///
1020
1020
/// `swap` takes an [`Ordering`] argument which describes the memory ordering of this
1021
1021
/// operation.
@@ -1169,7 +1169,7 @@ macro_rules! atomic_int {
1169
1169
}
1170
1170
}
1171
1171
1172
- /// Add to the current value, returning the previous value.
1172
+ /// Adds to the current value, returning the previous value.
1173
1173
///
1174
1174
/// This operation wraps around on overflow.
1175
1175
///
@@ -1188,7 +1188,7 @@ macro_rules! atomic_int {
1188
1188
unsafe { atomic_add( self . v. get( ) , val, order) }
1189
1189
}
1190
1190
1191
- /// Subtract from the current value, returning the previous value.
1191
+ /// Subtracts from the current value, returning the previous value.
1192
1192
///
1193
1193
/// This operation wraps around on overflow.
1194
1194
///
@@ -1207,7 +1207,12 @@ macro_rules! atomic_int {
1207
1207
unsafe { atomic_sub( self . v. get( ) , val, order) }
1208
1208
}
1209
1209
1210
- /// Bitwise and with the current value, returning the previous value.
1210
+ /// Bitwise "and" with the current value.
1211
+ ///
1212
+ /// Performs a bitwise "and" operation on the current value and the argument `val`, and
1213
+ /// sets the new value to the result.
1214
+ ///
1215
+ /// Returns the previous value.
1211
1216
///
1212
1217
/// # Examples
1213
1218
///
@@ -1223,7 +1228,12 @@ macro_rules! atomic_int {
1223
1228
unsafe { atomic_and( self . v. get( ) , val, order) }
1224
1229
}
1225
1230
1226
- /// Bitwise or with the current value, returning the previous value.
1231
+ /// Bitwise "or" with the current value.
1232
+ ///
1233
+ /// Performs a bitwise "or" operation on the current value and the argument `val`, and
1234
+ /// sets the new value to the result.
1235
+ ///
1236
+ /// Returns the previous value.
1227
1237
///
1228
1238
/// # Examples
1229
1239
///
@@ -1239,7 +1249,12 @@ macro_rules! atomic_int {
1239
1249
unsafe { atomic_or( self . v. get( ) , val, order) }
1240
1250
}
1241
1251
1242
- /// Bitwise xor with the current value, returning the previous value.
1252
+ /// Bitwise "xor" with the current value.
1253
+ ///
1254
+ /// Performs a bitwise "xor" operation on the current value and the argument `val`, and
1255
+ /// sets the new value to the result.
1256
+ ///
1257
+ /// Returns the previous value.
1243
1258
///
1244
1259
/// # Examples
1245
1260
///
@@ -1387,7 +1402,7 @@ unsafe fn atomic_swap<T>(dst: *mut T, val: T, order: Ordering) -> T {
1387
1402
}
1388
1403
}
1389
1404
1390
- /// Returns the old value (like __sync_fetch_and_add).
1405
+ /// Returns the previous value (like __sync_fetch_and_add).
1391
1406
#[ inline]
1392
1407
unsafe fn atomic_add < T > ( dst : * mut T , val : T , order : Ordering ) -> T {
1393
1408
match order {
@@ -1400,7 +1415,7 @@ unsafe fn atomic_add<T>(dst: *mut T, val: T, order: Ordering) -> T {
1400
1415
}
1401
1416
}
1402
1417
1403
- /// Returns the old value (like __sync_fetch_and_sub).
1418
+ /// Returns the previous value (like __sync_fetch_and_sub).
1404
1419
#[ inline]
1405
1420
unsafe fn atomic_sub < T > ( dst : * mut T , val : T , order : Ordering ) -> T {
1406
1421
match order {
0 commit comments