mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
Fix compare_and_swap in Windows thread_parker
This commit is contained in:
parent
3eef20ffa0
commit
865e4797df
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user