summary refs log tree commit diff
path: root/src/libstd/sync
diff options
context:
space:
mode:
authorinrustwetrust <inrustwetrust@users.noreply.github.com>2015-04-28 21:07:21 +0200
committerinrustwetrust <inrustwetrust@users.noreply.github.com>2015-04-28 21:07:21 +0200
commited4c05e5971ad48d8df08e83360e7ddc0871772a (patch)
tree97ca52ba887d6d61c75760442847ce94b76db504 /src/libstd/sync
parentd8b64c7fb2809eeba8ff9125cc95c4c38efb9a8a (diff)
downloadrust-ed4c05e5971ad48d8df08e83360e7ddc0871772a.tar.gz
rust-ed4c05e5971ad48d8df08e83360e7ddc0871772a.zip
Clarify Once::call_once memory ordering guarantees in docs
Diffstat (limited to 'src/libstd/sync')
-rw-r--r--src/libstd/sync/once.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs
index 2ce974c1271..2d712369228 100644
--- a/src/libstd/sync/once.rs
+++ b/src/libstd/sync/once.rs
@@ -59,7 +59,11 @@ impl Once {
     /// routine is currently running.
     ///
     /// When this function returns, it is guaranteed that some initialization
-    /// has run and completed (it may not be the closure specified).
+    /// has run and completed (it may not be the closure specified). It is also
+    /// guaranteed that any memory writes performed by the executed closure can
+    /// be reliably observed by other tasks at this point (there is a
+    /// happens-before relation between the closure and code executing after the
+    /// return).
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn call_once<F>(&'static self, f: F) where F: FnOnce() {
         // Optimize common path: load is much cheaper than fetch_add.