Struct executors::crossbeam_workstealing_pool::ThreadPool [−][src]
pub struct ThreadPool { /* fields omitted */ }Methods
impl ThreadPool[src]
impl ThreadPoolpub fn new(threads: usize) -> ThreadPool[src]
pub fn new(threads: usize) -> ThreadPoolCreates a new thread pool capable of executing threads number of jobs concurrently.
Panics
This function will panic if threads is 0.
Examples
Create a new thread pool capable of executing four jobs concurrently:
use executors::*; use executors::crossbeam_workstealing_pool::ThreadPool; let pool = ThreadPool::new(4);
Trait Implementations
impl Clone for ThreadPool[src]
impl Clone for ThreadPoolfn clone(&self) -> ThreadPool[src]
fn clone(&self) -> ThreadPoolReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Executor for ThreadPool[src]
impl Executor for ThreadPoolfn execute<F>(&self, job: F) where
F: FnOnce() + Send + 'static, [src]
fn execute<F>(&self, job: F) where
F: FnOnce() + Send + 'static, Executes the function job on the Executor. Read more
fn shutdown_async(&self)[src]
fn shutdown_async(&self)Shutdown the Executor without waiting. Read more
fn shutdown_borrowed(&self) -> Result<(), String>[src]
fn shutdown_borrowed(&self) -> Result<(), String>Same as shutdown but without consuming self Read more
fn shutdown(self) -> Result<(), String>[src]
fn shutdown(self) -> Result<(), String>Shutdown an Executor and wait for it to shut down all workers. Read more
Auto Trait Implementations
impl Send for ThreadPool
impl Send for ThreadPoolimpl Sync for ThreadPool
impl Sync for ThreadPool