This commit is contained in:
cynecx 2020-12-24 20:39:42 +09:00 committed by GitHub
commit f03f0aa756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -2,7 +2,7 @@
use std::cell::UnsafeCell;
use std::fmt;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::{self, AtomicUsize};
use std::sync::atomic::Ordering::{Acquire, Release, AcqRel};
use std::task::Waker;
@ -330,6 +330,9 @@ impl AtomicWaker {
// could also spin here trying to acquire the lock
// to register).
waker.wake_by_ref();
// This is equivalent to a spin lock, so use a spin hint.
atomic::spin_loop_hint();
}
state => {
// In this case, a concurrent thread is holding the