Skip to content

Commit

Permalink
Auto merge of #114591 - joboet:thread_parking_ordering_fix, r=thomcc
Browse files Browse the repository at this point in the history
Synchronize with all calls to `unpark` in id-based thread parker

[The documentation for `thread::park`](https://doc.rust-lang.org/nightly/std/thread/fn.park.html#memory-ordering) guarantees that "park synchronizes-with all prior unpark operations". In the id-based thread parking implementation, this is not implemented correctly, as the state variable is reset with a simple store, so there will not be a *synchronizes-with* edge if an `unpark` happens just before the reset. This PR corrects this, replacing the load-check-reset sequence with a single `compare_exchange`.
  • Loading branch information
bors committed Aug 18, 2023
2 parents 4927f9b + 6eced34 commit 3796cea
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 3796cea

Please sign in to comment.