We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2de81f commit 07149e0Copy full SHA for 07149e0
src/librustc_trans/back/write.rs
@@ -1356,6 +1356,16 @@ fn start_executing_work(sess: &Session,
1356
maybe_start_llvm_timer(&item, &mut llvm_start_time);
1357
main_thread_worker_state = MainThreadWorkerState::LLVMing;
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;
1369
}
1370
1371
MainThreadWorkerState::Translating => {
0 commit comments