diff options
| author | inrustwetrust <inrustwetrust@users.noreply.github.com> | 2015-04-28 21:07:21 +0200 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-05-10 15:20:07 -0400 |
| commit | b84f018bb48b3ce99d18155b4d8620e04ef058bd (patch) | |
| tree | 29084c7a2ec76e118dd76ea10766023b6f8beb44 /src | |
| parent | 7a0af01bd4ec35898cbc20b584014864a952d04a (diff) | |
| download | rust-b84f018bb48b3ce99d18155b4d8620e04ef058bd.tar.gz rust-b84f018bb48b3ce99d18155b4d8620e04ef058bd.zip | |
Clarify Once::call_once memory ordering guarantees in docs
Diffstat (limited to 'src')
| -rw-r--r-- | src/libstd/sync/once.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 948965f5efa..7d203e0c980 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. |
