Use const fn to abstract away the contents of UnsafeCell & friends.

This commit is contained in:
Eduard Burtescu 2015-05-27 11:18:36 +03:00
parent 6e8e4f847c
commit 377b0900ae
76 changed files with 417 additions and 525 deletions

View file

@ -11,7 +11,7 @@
//! Generic support for building blocking abstractions.
use thread::{self, Thread};
use sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT, Ordering};
use sync::atomic::{AtomicBool, Ordering};
use sync::Arc;
use marker::{Sync, Send};
use mem;
@ -41,7 +41,7 @@ impl !Sync for WaitToken {}
pub fn tokens() -> (WaitToken, SignalToken) {
let inner = Arc::new(Inner {
thread: thread::current(),
woken: ATOMIC_BOOL_INIT,
woken: AtomicBool::new(false),
});
let wait_token = WaitToken {
inner: inner.clone(),