[][src]Trait executors::parker::Parker

pub trait Parker: Send + Clone {
    fn max_threads(&self) -> Option<usize>;
fn park(&self, thread_id: usize);
fn unpark_one(&self);
fn unpark_all(&self); }

Required methods

fn max_threads(&self) -> Option<usize>

Maximum number of threads supported by this parker implementation.

fn park(&self, thread_id: usize)

Parks this thread until it gets woken up.

The provided id must fit into the underlying parker implementation, or a panic will be issued!

A parked thread may spuriously wake up or the method may return immediately without parking the thread at all. Parking is only guaranteed to happen if there is no contention on the inner lock.

fn unpark_one(&self)

Unparks at least one thread, if any threads are sleeping. It may unpark more than one thread for efficiency.

fn unpark_all(&self)

Unpark all sleeping threads.

Loading content...

Implementors

impl Parker for DynParker[src]

impl<T> Parker for StaticParker<T> where
    T: ThreadData + Send + Sync + 'static, 
[src]

Loading content...