Fallout from stabilization
This commit is contained in:
parent
d8f8f7a58c
commit
d0de2b46e9
89 changed files with 578 additions and 558 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
//! Generic support for building blocking abstractions.
|
||||
|
||||
use thread::Thread;
|
||||
use thread::{self, Thread};
|
||||
use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
|
||||
use sync::Arc;
|
||||
use marker::{Sync, Send};
|
||||
|
|
@ -40,7 +40,7 @@ impl !Sync for WaitToken {}
|
|||
|
||||
pub fn tokens() -> (WaitToken, SignalToken) {
|
||||
let inner = Arc::new(Inner {
|
||||
thread: Thread::current(),
|
||||
thread: thread::current(),
|
||||
woken: ATOMIC_BOOL_INIT,
|
||||
});
|
||||
let wait_token = WaitToken {
|
||||
|
|
@ -80,7 +80,7 @@ impl SignalToken {
|
|||
impl WaitToken {
|
||||
pub fn wait(self) {
|
||||
while !self.inner.woken.load(Ordering::SeqCst) {
|
||||
Thread::park()
|
||||
thread::park()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue