Struct my_threadpool::ThreadPool
source · pub struct ThreadPool { /* private fields */ }
Expand description
A ThreadPool that runs the given task with the given threads. If all the threads are occupied then it waits until a new thread is available.
Implementations§
source§impl ThreadPool
impl ThreadPool
sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Returns a new instce of ThreadPool. The ThreadPool::new() method takes an argument which is the number of threads the threadpool has.
Examples
let pool = ThreadPool::new(4);
pub fn shutdown(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ThreadPool
impl Send for ThreadPool
impl Sync for ThreadPool
impl Unpin for ThreadPool
impl !UnwindSafe for ThreadPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more