pub(crate) struct SyncWaker {
inner: Mutex<Waker>,
is_empty: Atomic<bool>,
}
🔬This is a nightly-only experimental API. (
mpmc_channel
#126840)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>
🔬This is a nightly-only experimental API. (
mpmc_channel
#126840)The inner Waker
.
is_empty: Atomic<bool>
🔬This is a nightly-only experimental API. (
mpmc_channel
#126840)true
if the waker is empty.
Implementations§
Source§impl SyncWaker
impl SyncWaker
Sourcepub(crate) fn new() -> Self
🔬This is a nightly-only experimental API. (mpmc_channel
#126840)
pub(crate) fn new() -> Self
mpmc_channel
#126840)Creates a new SyncWaker
.
Sourcepub(crate) fn register(&self, oper: Operation, cx: &Context)
🔬This is a nightly-only experimental API. (mpmc_channel
#126840)
pub(crate) fn register(&self, oper: Operation, cx: &Context)
mpmc_channel
#126840)Registers the current thread with an operation.
Sourcepub(crate) fn unregister(&self, oper: Operation) -> Option<Entry>
🔬This is a nightly-only experimental API. (mpmc_channel
#126840)
pub(crate) fn unregister(&self, oper: Operation) -> Option<Entry>
mpmc_channel
#126840)Unregisters an operation previously registered by the current thread.
Sourcepub(crate) fn notify(&self)
🔬This is a nightly-only experimental API. (mpmc_channel
#126840)
pub(crate) fn notify(&self)
mpmc_channel
#126840)Attempts to find one thread (not the current one), select its operation, and wake it up.
Sourcepub(crate) fn disconnect(&self)
🔬This is a nightly-only experimental API. (mpmc_channel
#126840)
pub(crate) fn disconnect(&self)
mpmc_channel
#126840)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
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more