pub struct WakeSource { /* private fields */ }Expand description
Releases a runtime owner thread parked in RuntimeHandle::pump.
A wake source is usable from any thread, which a host’s task submission and shutdown paths rely on. Each source holds its own reference to the runtime’s wake state, so it stays usable after the runtime closes and signalling it then does nothing.
Implementations§
Source§impl WakeSource
impl WakeSource
Sourcepub fn signal(&self) -> Result<()>
pub fn signal(&self) -> Result<()>
Sets the runtime’s wake flag and releases the parked owner thread.
A signal raised while the owner thread is running sets the wake flag,
so the next RuntimeHandle::pump returns without parking. Signalling
after the runtime closes succeeds and does nothing.
Trait Implementations§
Source§impl Debug for WakeSource
impl Debug for WakeSource
Source§impl Drop for WakeSource
impl Drop for WakeSource
impl Send for WakeSource
impl Sync for WakeSource
Auto Trait Implementations§
impl Freeze for WakeSource
impl RefUnwindSafe for WakeSource
impl Unpin for WakeSource
impl UnsafeUnpin for WakeSource
impl UnwindSafe for WakeSource
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