Skip to content

Commit

Permalink
Revert the usage of compare_exchange_weak
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Nov 22, 2020
1 parent 7a40b6d commit 50b2ade
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys_common/thread_parker/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Parker {
// Wait for something to happen, assuming it's still set to PARKED.
futex_wait(&self.state, PARKED, None);
// Change NOTIFIED=>EMPTY and return in that case.
if self.state.compare_exchange_weak(NOTIFIED, EMPTY, Acquire, Acquire).is_ok() {
if self.state.compare_exchange(NOTIFIED, EMPTY, Acquire, Acquire).is_ok() {
return;
} else {
// Spurious wake up. We loop to try again.
Expand Down

0 comments on commit 50b2ade

Please sign in to comment.