Struct scope_threadpool::Pool [] [src]

pub struct Pool<StateMaker, State> { /* fields omitted */ }

Holds a number of threads that you can run tasks on

Methods

impl<StateMaker, State> Pool<StateMaker, State> where
    StateMaker: Fn() -> State + 'static + Send + Sync,
    State: 'static, 
[src]

[src]

Spawn a number of threads each of which call a state making function.

[src]

Spawn a number of threads. The pool's queue of pending jobs is limited.

backlog is the number of jobs that haven't been run. If specified, Scope::execute will block until a job completes.

state_maker is a function that is run on each thread and creates an object, owned by that thread, which is passed to the jobs' closures.

[src]

Store the current scope so that you can run jobs in it.

This function panics if the given closure or any threads panic.

Does not return until all executed jobs complete.

Trait Implementations

impl<StateMaker, State> Drop for Pool<StateMaker, State>
[src]

[src]

terminates all threads