Struct scoped_threadpool::Pool [−][src]
pub struct Pool { /* fields omitted */ }A threadpool that acts as a handle to a number of threads spawned at construction.
Methods
impl Pool[src]
impl Poolpub fn new(n: u32) -> Pool[src]
pub fn new(n: u32) -> PoolConstruct a threadpool with the given number of threads.
Minimum value is 1.
pub fn scoped<'pool, 'scope, F, R>(&'pool mut self, f: F) -> R where
F: FnOnce(&Scope<'pool, 'scope>) -> R, [src]
pub fn scoped<'pool, 'scope, F, R>(&'pool mut self, f: F) -> R where
F: FnOnce(&Scope<'pool, 'scope>) -> R, Borrows the pool and allows executing jobs on other threads during that scope via the argument of the closure.
This method will block until the closure and all its jobs have run to completion.
pub fn thread_count(&self) -> u32[src]
pub fn thread_count(&self) -> u32Returns the number of threads inside this pool.