Skip to content

Document memory orderings of thread::{park, unpark} #99587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tidy
Co-authored-by: yvt <i@yvt.jp>
  • Loading branch information
ibraheemdev and yvt authored Oct 5, 2022
commit 1bae661dbc0b9fd3397e0df00b176bf13f346cff
4 changes: 2 additions & 2 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ pub fn sleep(dur: Duration) {
/// * It can be implemented very efficiently on many platforms.
///
/// # Memory Orderings
///
///
/// Calls to `park` _synchronize-with_ calls to `unpark`, meaning that memory
/// operations performed before a call to `unpark` are made visible to the thread that
/// consumes the token and returns from `park`. Note that all `park` and `unpark`
Expand All @@ -890,7 +890,7 @@ pub fn sleep(dur: Duration) {
/// In atomic ordering terms, `unpark` performs a `Release` operation and `park`
/// performs the corresponding `Acquire` operation. Calls to `unpark` for the same
/// thread form a [release sequence].
///
///
/// Notice that being unblocked does not imply any synchronization with someone that
/// unparked this thread, it could also be spurious. For example, it would be a valid,
/// but inefficient, implementation to make both park and unpark return immediately
Expand Down