Skip to content

Commit aa9a2cc

Browse files
authored
Rollup merge of rust-lang#53389 - RalfJung:thread-join, r=sfackler
document effect of join on memory ordering Fixes rust-lang#45467
2 parents 644f8f1 + 31b63d0 commit aa9a2cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/thread/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1310,11 +1310,17 @@ impl<T> JoinHandle<T> {
13101310

13111311
/// Waits for the associated thread to finish.
13121312
///
1313+
/// In terms of [atomic memory orderings], the completion of the associated
1314+
/// thread synchronizes with this function returning. In other words, all
1315+
/// operations performed by that thread are ordered before all
1316+
/// operations that happen after `join` returns.
1317+
///
13131318
/// If the child thread panics, [`Err`] is returned with the parameter given
13141319
/// to [`panic`].
13151320
///
13161321
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
13171322
/// [`panic`]: ../../std/macro.panic.html
1323+
/// [atomic memory orderings]: ../../std/sync/atomic/index.html
13181324
///
13191325
/// # Panics
13201326
///

0 commit comments

Comments
 (0)