pub fn load_gate(jobs: usize, limit: Option<f64>) -> Option<Arc<AtomicUsize>>Expand description
Start adapting the concurrency to the load, or None when there is nothing
to adapt: no --load-limit, a single job, or no load average to read.
The returned gate is what crate::sched::run_gated admits. A detached
thread moves it every [LOAD_CHECK] and stops once nobody else holds the
gate, so it costs one sleeping thread for the length of the run.