Skip to content

Commit 865e479

Browse files
committed
Fix compare_and_swap in Windows thread_parker
1 parent 3eef20f commit 865e479

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/windows/thread_parker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Parker {
113113
// Wait for something to happen, assuming it's still set to PARKED.
114114
c::WaitOnAddress(self.ptr(), &PARKED as *const _ as c::LPVOID, 1, c::INFINITE);
115115
// Change NOTIFIED=>EMPTY but leave PARKED alone.
116-
if self.state.compare_and_swap(NOTIFIED, EMPTY, Acquire) == NOTIFIED {
116+
if self.state.compare_exchange(NOTIFIED, EMPTY, Acquire, Acquire) == NOTIFIED {
117117
// Actually woken up by unpark().
118118
return;
119119
} else {

0 commit comments

Comments
 (0)