File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ impl ConcurrencyLimiter {
4949 state = self . available_token_condvar . wait ( state) . unwrap ( ) ;
5050 }
5151 }
52+
53+ pub ( super ) fn job_already_done ( & mut self ) {
54+ let mut state = self . state . lock ( ) . unwrap ( ) ;
55+ state. job_already_done ( ) ;
56+ }
5257}
5358
5459impl Drop for ConcurrencyLimiter {
@@ -137,6 +142,14 @@ mod state {
137142 self . assert_invariants ( ) ;
138143 }
139144
145+ pub ( super ) fn job_already_done ( & mut self ) {
146+ self . assert_invariants ( ) ;
147+ self . pending_jobs -= 1 ;
148+ self . assert_invariants ( ) ;
149+ self . drop_excess_capacity ( ) ;
150+ self . assert_invariants ( ) ;
151+ }
152+
140153 fn drop_excess_capacity ( & mut self ) {
141154 self . assert_invariants ( ) ;
142155 if self . active_jobs == self . pending_jobs {
Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ pub(crate) fn run_aot(
391391 }
392392 CguReuse :: PreLto => unreachable ! ( ) ,
393393 CguReuse :: PostLto => {
394+ concurrency_limiter. job_already_done ( ) ;
394395 OngoingModuleCodegen :: Sync ( reuse_workproduct_for_cgu ( tcx, & * cgu) )
395396 }
396397 }
You can’t perform that action at this time.
0 commit comments