File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1356,6 +1356,16 @@ fn start_executing_work(sess: &Session,
1356
1356
maybe_start_llvm_timer ( & item, & mut llvm_start_time) ;
1357
1357
main_thread_worker_state = MainThreadWorkerState :: LLVMing ;
1358
1358
spawn_work ( cgcx, item) ;
1359
+ } else {
1360
+ // There is no unstarted work, so let the main thread
1361
+ // take over for a running worker. Otherwise the
1362
+ // implicit token would just go to waste.
1363
+ // We reduce the `running` counter by one. The
1364
+ // `tokens.truncate()` below will take care of
1365
+ // giving the Token back.
1366
+ debug_assert ! ( running > 0 ) ;
1367
+ running -= 1 ;
1368
+ main_thread_worker_state = MainThreadWorkerState :: LLVMing ;
1359
1369
}
1360
1370
}
1361
1371
MainThreadWorkerState :: Translating => {
You can’t perform that action at this time.
0 commit comments