Make sure to count reused cgus towards the count of jobs done
This commit is contained in:
parent
5b4195669e
commit
f71c545746
@ -49,6 +49,11 @@ impl ConcurrencyLimiter {
|
||||
state = self.available_token_condvar.wait(state).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn job_already_done(&mut self) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.job_already_done();
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ConcurrencyLimiter {
|
||||
@ -137,6 +142,14 @@ mod state {
|
||||
self.assert_invariants();
|
||||
}
|
||||
|
||||
pub(super) fn job_already_done(&mut self) {
|
||||
self.assert_invariants();
|
||||
self.pending_jobs -= 1;
|
||||
self.assert_invariants();
|
||||
self.drop_excess_capacity();
|
||||
self.assert_invariants();
|
||||
}
|
||||
|
||||
fn drop_excess_capacity(&mut self) {
|
||||
self.assert_invariants();
|
||||
if self.active_jobs == self.pending_jobs {
|
||||
|
@ -391,6 +391,7 @@ pub(crate) fn run_aot(
|
||||
}
|
||||
CguReuse::PreLto => unreachable!(),
|
||||
CguReuse::PostLto => {
|
||||
concurrency_limiter.job_already_done();
|
||||
OngoingModuleCodegen::Sync(reuse_workproduct_for_cgu(tcx, &*cgu))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user