Ensures that there is at least one worker thread attached to the thread pool. This is mostly used to avoid deadlocks. This should be called before blocking on a thread pool to ensure the block will eventually be released. Returns the new size of the pool, which will be either the old size or one. See [`ThreadPool::resize_to`] for more information about resizing.
(&'static self)
| 266 | #[inline(always)] |
| 267 | pub fn num_members(&'static self) -> usize { |
| 268 | self.claimed_bitmask.load(Ordering::Relaxed).count_ones() as usize |
| 269 | } |
| 270 | |
| 271 | /// Adds a job to the thread-pool's shared queue. |
| 272 | /// |
| 273 | /// This allows adding work from outside the pool (eg, without a reference |
| 274 | /// to a `Worker`). |
| 275 | /// |
| 276 | /// Note: Workers only take work from this queue as a last resort, after all |
| 277 | /// their other work has been exhausted. |