未验证 提交 454f3ed9 编写于 作者: L Linus Färnstrand 提交者: GitHub

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

Co-authored-by: NMara Bos <m-ou.se@m-ou.se>
上级 865e4797
......@@ -113,7 +113,7 @@ pub unsafe fn park(&self) {
// 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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册