pub struct CheckQueue<T> { /* private fields */ }
Expand description
| Queue for verifications that have to | be performed. | | The verifications are represented | by a type T, which must provide an operator(), | returning a bool. | | One thread (the master) is assumed to | push batches of verifications onto | the queue, where they are processed | by N-1 worker threads. When the master | is done adding work, it temporarily | joins the worker pool as an N’th worker, | until all jobs are done. |
Implementations§
Source§impl<T> CheckQueue<T>
impl<T> CheckQueue<T>
Sourcepub fn loop_(&mut self, master: bool) -> bool
pub fn loop_(&mut self, master: bool) -> bool
| Internal function that does bulk of | the verification work. |
Sourcepub fn start_worker_threads(&mut self, threads_num: i32)
pub fn start_worker_threads(&mut self, threads_num: i32)
| Create a pool of new worker threads. |
Sourcepub fn wait(&mut self) -> bool
pub fn wait(&mut self) -> bool
| Wait until execution finishes, and | return whether all evaluations were | successful. |
Sourcepub fn stop_worker_threads(&mut self)
pub fn stop_worker_threads(&mut self)
| Stop all of the worker threads. |
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for CheckQueue<T>
impl<T> RefUnwindSafe for CheckQueue<T>
impl<T> Send for CheckQueue<T>where
T: Send,
impl<T> Sync for CheckQueue<T>where
T: Send,
impl<T> Unpin for CheckQueue<T>where
T: Unpin,
impl<T> UnwindSafe for CheckQueue<T>
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