This is the main loop for a worker thread. It's in charge of executing jobs. Operating on the principle that you should finish what you start before starting something new, workers will first execute their queue, then execute shared jobs, then pull new jobs from the injector.
(membership: Membership, halt: Arc<AtomicBool>)
| 2508 | } |
| 2509 | } |
| 2510 | |
| 2511 | // ----------------------------------------------------------------------------- |
| 2512 | // Implicit worker registration api |
| 2513 | |
| 2514 | /// A [`ThreadPool`] wrapper, used by the [`DEFAULT_POOL`]. |
| 2515 | /// |
| 2516 | /// This dereferences to a [`ThreadPool`]. The first time it is dereferenced, it |
| 2517 | /// resizes itself to fill all available cores. |
| 2518 | pub struct DefaultThreadPool { |
| 2519 | thread_pool: &'static ThreadPool, |
| 2520 | initialized: AtomicU32, |
| 2521 | } |
| 2522 |