[−][src]Struct crossbeam::sync::Unparker
Unparks a thread parked by the associated Parker
.
Methods
impl Unparker
[src]
pub fn unpark(&self)
[src]
Atomically makes the token available if it is not already.
This method will wake up the thread blocked on park
or park_timeout
, if there is
any.
Examples
use std::thread; use std::time::Duration; use crossbeam_utils::sync::Parker; let mut p = Parker::new(); let u = p.unparker().clone(); thread::spawn(move || { thread::sleep(Duration::from_millis(500)); u.unpark(); }); // Wakes up when `u.unpark()` provides the token, but may also wake up // spuriously before that without consuming the token. p.park();
Trait Implementations
impl Debug for Unparker
[src]
impl Clone for Unparker
[src]
impl Sync for Unparker
[src]
impl Send for Unparker
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Wfn borrow_mut(&mut self) -> &mut T
[src]
ⓘImportant traits for &'_ mut W
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,