Join all the worker threads. Transfer pass timings from the worker threads to the current thread.
(&mut self)
| 80 | /// Join all the worker threads. |
| 81 | /// Transfer pass timings from the worker threads to the current thread. |
| 82 | pub fn join(&mut self) -> timing::PassTimes { |
| 83 | assert!(self.request_tx.is_none(), "must shutdown before join"); |
| 84 | let mut pass_times = timing::PassTimes::default(); |
| 85 | for h in self.handles.drain(..) { |
| 86 | match h.join() { |
| 87 | Ok(t) => pass_times.add(&t), |
| 88 | Err(e) => println!("worker panicked: {e:?}"), |
| 89 | } |
| 90 | } |
| 91 | pass_times |
| 92 | } |
| 93 | |
| 94 | /// Add a new job to the queues. |
| 95 | pub fn put(&mut self, jobid: usize, path: &Path) { |