Skip to content

Commit

Permalink
Fix compare_and_swap in Windows thread_parker
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Dec 22, 2020
1 parent 3eef20f commit 865e479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/windows/thread_parker.rs
Expand Up @@ -113,7 +113,7 @@ impl Parker {
// Wait for something to happen, assuming it's still set to PARKED.
c::WaitOnAddress(self.ptr(), &PARKED as *const _ as c::LPVOID, 1, c::INFINITE);
// Change NOTIFIED=>EMPTY but leave PARKED alone.
if self.state.compare_and_swap(NOTIFIED, EMPTY, Acquire) == NOTIFIED {
if self.state.compare_exchange(NOTIFIED, EMPTY, Acquire, Acquire) == NOTIFIED {
// Actually woken up by unpark().
return;
} else {
Expand Down

0 comments on commit 865e479

Please sign in to comment.