Struct crossbeam_channel::waker::SyncWaker
source · pub(crate) struct SyncWaker {
inner: Mutex<Waker>,
is_empty: AtomicBool,
}
Expand description
A waker that can be shared among threads without locking.
This is a simple wrapper around Waker
that internally uses a mutex for synchronization.
Fields§
§inner: Mutex<Waker>
The inner Waker
.
is_empty: AtomicBool
true
if the waker is empty.
Implementations§
source§impl SyncWaker
impl SyncWaker
sourcepub(crate) fn register(&self, oper: Operation, cx: &Context)
pub(crate) fn register(&self, oper: Operation, cx: &Context)
Registers the current thread with an operation.
sourcepub(crate) fn unregister(&self, oper: Operation) -> Option<Entry>
pub(crate) fn unregister(&self, oper: Operation) -> Option<Entry>
Unregisters an operation previously registered by the current thread.
sourcepub(crate) fn notify(&self)
pub(crate) fn notify(&self)
Attempts to find one thread (not the current one), select its operation, and wake it up.
sourcepub(crate) fn watch(&self, oper: Operation, cx: &Context)
pub(crate) fn watch(&self, oper: Operation, cx: &Context)
Registers an operation waiting to be ready.
sourcepub(crate) fn disconnect(&self)
pub(crate) fn disconnect(&self)
Notifies all threads that the channel is disconnected.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SyncWaker
impl RefUnwindSafe for SyncWaker
impl !Send for SyncWaker
impl !Sync for SyncWaker
impl Unpin for SyncWaker
impl UnwindSafe for SyncWaker
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more