diff options
Diffstat (limited to 'src/pipeline')
| -rw-r--r-- | src/pipeline/dispatch.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/pipeline/dispatch.rs b/src/pipeline/dispatch.rs index ad2d627..13590ae 100644 --- a/src/pipeline/dispatch.rs +++ b/src/pipeline/dispatch.rs @@ -9,9 +9,7 @@ use crate::db::{self, builds, Db}; use crate::pipeline::{self, Outcome}; pub struct Pool { - // Read only by `shutdown`, which is compiled for the test tier: a release - // build starts the dispatcher and runs it until the process exits, so in - // that build these two fields are stored and never read. + // Read only by `shutdown`; a release build runs the pool until exit. #[cfg_attr(not(feature = "test-support"), allow(dead_code))] stop: Arc<AtomicBool>, #[cfg_attr(not(feature = "test-support"), allow(dead_code))] @@ -50,11 +48,8 @@ impl Pool { Pool { stop, handles } } - /// Stop the dispatcher threads and join them. - /// - /// Production runs the pool until the process exits; nothing asks it to - /// stop. A test needs the join, because it asserts on the pool's effects - /// and cannot do that while the threads are still running. + /// Stop the dispatcher threads and join them, so a test can assert on the + /// pool's effects. #[cfg(feature = "test-support")] pub fn shutdown(self) { self.stop.store(true, Ordering::SeqCst); @@ -110,7 +105,7 @@ fn dispatch_once_impl(cfg: &Config, db: &Db, tx: &Sender<String>) -> Vec<String> ids } -/// Production reaches this through `dispatch_once`, which is the only thing that acts on the answer. +/// Reached only through `dispatch_once`. #[cfg(feature = "test-support")] pub fn admissible(cfg: &Config, db: &Db) -> usize { admissible_impl(cfg, db) @@ -134,7 +129,7 @@ fn admissible_impl(cfg: &Config, db: &Db) -> usize { slots } -/// Production reaches this through `admissible`, which is the only thing that acts on the number. +/// Reached only through `admissible`. #[cfg(feature = "test-support")] pub fn free_disk_mb(path: &std::path::Path) -> u64 { free_disk_mb_impl(path) |
