Skip to content

Commit 34b65db

Browse files
committed
document effect of join on memory ordering
1 parent 81cfaad commit 34b65db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libstd/thread/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1308,13 +1308,17 @@ impl<T> JoinHandle<T> {
13081308
&self.0.thread
13091309
}
13101310

1311-
/// Waits for the associated thread to finish.
1311+
/// Waits for the associated thread to finish. In terms of [atomic memory orderings],
1312+
/// the completion of the associated thread synchronizes with this function returning.
1313+
/// In other words, all operations performed by that thread are ordered before all
1314+
/// operations that happen after `join` returns.
13121315
///
13131316
/// If the child thread panics, [`Err`] is returned with the parameter given
13141317
/// to [`panic`].
13151318
///
13161319
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
13171320
/// [`panic`]: ../../std/macro.panic.html
1321+
/// [atomic memory orderings]: ../../std/sync/atomic/index.html
13181322
///
13191323
/// # Panics
13201324
///

0 commit comments

Comments
 (0)