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 {
49
49
state = self . available_token_condvar . wait ( state) . unwrap ( ) ;
50
50
}
51
51
}
52
+
53
+ pub ( super ) fn job_already_done ( & mut self ) {
54
+ let mut state = self . state . lock ( ) . unwrap ( ) ;
55
+ state. job_already_done ( ) ;
56
+ }
52
57
}
53
58
54
59
impl Drop for ConcurrencyLimiter {
@@ -137,6 +142,14 @@ mod state {
137
142
self . assert_invariants ( ) ;
138
143
}
139
144
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
+
140
153
fn drop_excess_capacity ( & mut self ) {
141
154
self . assert_invariants ( ) ;
142
155
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(
391
391
}
392
392
CguReuse :: PreLto => unreachable ! ( ) ,
393
393
CguReuse :: PostLto => {
394
+ concurrency_limiter. job_already_done ( ) ;
394
395
OngoingModuleCodegen :: Sync ( reuse_workproduct_for_cgu ( tcx, & * cgu) )
395
396
}
396
397
}
You can’t perform that action at this time.
0 commit comments