Skip to content

Commit 5062a5b

Browse files
committed
Fix compare_and_swap in Windows thread_parker
1 parent 144f8ec commit 5062a5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

std/src/sys/windows/thread_parker.rs

Lines changed: 1 addition & 1 deletion
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)