]> git.lizzy.rs Git - rust.git/commitdiff
Update return value docs in atomics docs
authorSteve Klabnik <steve@steveklabnik.com>
Fri, 27 Mar 2015 19:37:11 +0000 (15:37 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Fri, 27 Mar 2015 19:37:11 +0000 (15:37 -0400)
Fixes #21668

src/libcore/atomic.rs

index c316236a8041291efd6ff1b588ecab8325b21921..056b97ea2da7d49916da5900d4bf29748083e4b3 100644 (file)
@@ -252,7 +252,8 @@ pub fn swap(&self, val: bool, order: Ordering) -> bool {
 
     /// Stores a value into the bool if the current value is the same as the expected value.
     ///
-    /// If the return value is equal to `old` then the value was updated.
+    /// The return value is always the previous value. If it is equal to `old`, then the value was
+    /// updated.
     ///
     /// `swap` also takes an `Ordering` argument which describes the memory ordering of this
     /// operation.
@@ -489,7 +490,8 @@ pub fn swap(&self, val: isize, order: Ordering) -> isize {
 
     /// Stores a value into the isize if the current value is the same as the expected value.
     ///
-    /// If the return value is equal to `old` then the value was updated.
+    /// The return value is always the previous value. If it is equal to `old`, then the value was
+    /// updated.
     ///
     /// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
     /// this operation.
@@ -676,7 +678,8 @@ pub fn swap(&self, val: usize, order: Ordering) -> usize {
 
     /// Stores a value into the usize if the current value is the same as the expected value.
     ///
-    /// If the return value is equal to `old` then the value was updated.
+    /// The return value is always the previous value. If it is equal to `old`, then the value was
+    /// updated.
     ///
     /// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
     /// this operation.
@@ -873,7 +876,8 @@ pub fn swap(&self, ptr: *mut T, order: Ordering) -> *mut T {
 
     /// Stores a value into the pointer if the current value is the same as the expected value.
     ///
-    /// If the return value is equal to `old` then the value was updated.
+    /// The return value is always the previous value. If it is equal to `old`, then the value was
+    /// updated.
     ///
     /// `compare_and_swap` also takes an `Ordering` argument which describes the memory ordering of
     /// this operation.