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

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
This commit is contained in:
Linus Färnstrand 2020-12-22 12:33:11 +01:00 committed by GitHub
parent 865e4797df
commit 454f3ed902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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_exchange(NOTIFIED, EMPTY, Acquire, Acquire) == NOTIFIED {
if self.state.compare_exchange(NOTIFIED, EMPTY, Acquire, Acquire).is_ok() {
// Actually woken up by unpark().
return;
} else {