condvar: UnsafeCell<AtomicU32>,
}
+pub type MovableCondvar = Box<Condvar>;
+
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}
sem2: *const c_void,
}
+pub type MovableCondvar = Box<Condvar>;
+
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}
inner: SpinMutex<WaitVariable<()>>,
}
+pub type MovableCondvar = Box<Condvar>;
+
impl Condvar {
pub const fn new() -> Condvar {
Condvar { inner: SpinMutex::new(WaitVariable::new(())) }
inner: UnsafeCell<libc::pthread_cond_t>,
}
+pub type MovableCondvar = Box<Condvar>;
+
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}
pub struct Condvar {}
+pub type MovableCondvar = Box<Condvar>;
+
impl Condvar {
pub const fn new() -> Condvar {
Condvar {}
inner: UnsafeCell<libc::pthread_cond_t>,
}
+pub type MovableCondvar = Box<Condvar>;
+
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}
cnt: AtomicUsize,
}
+pub type MovableCondvar = Box<Condvar>;
+
// Condition variables are implemented with a simple counter internally that is
// likely to cause spurious wakeups. Blocking on a condition variable will first
// read the value of the internal counter, unlock the given mutex, and then
inner: UnsafeCell<c::CONDITION_VARIABLE>,
}
+pub type MovableCondvar = Box<Condvar>;
+
unsafe impl Send for Condvar {}
unsafe impl Sync for Condvar {}
/// An OS-based condition variable.
pub struct Condvar {
- inner: Box<imp::Condvar>,
+ inner: imp::MovableCondvar,
check: CondvarCheck,
}
impl Condvar {
/// Creates a new condition variable for use.
pub fn new() -> Self {
- let mut c = box imp::Condvar::new();
+ let mut c = imp::MovableCondvar::from(imp::Condvar::new());
unsafe { c.init() };
Self { inner: c, check: CondvarCheck::new() }
}