Struct scoped_threadpool::Pool
[−]
[src]
pub struct Pool { // some fields omitted }
A threadpool that acts as a handle to a number of threads spawned at construction.
Methods
impl Pool
[src]
fn new(n: u32) -> Pool
Construct a threadpool with the given number of threads.
Minimum value is 1
.
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.
fn thread_count(&self) -> u32
Returns the number of threads inside this pool.