Skip to content

Commit

Permalink
async-llvm(26): Print error when failing to acquire Jobserver token.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Jul 31, 2017
1 parent a9a0ea9 commit cacc31f
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/librustc_trans/back/write.rs
Expand Up @@ -1389,21 +1389,25 @@ fn start_executing_work(sess: &Session,
// this to spawn a new unit of work, or it may get dropped
// immediately if we have no more work to spawn.
Message::Token(token) => {
if let Ok(token) = token {
tokens.push(token);

if main_thread_worker_state == MainThreadWorkerState::LLVMing {
// If the main thread token is used for LLVM work
// at the moment, we turn that thread into a regular
// LLVM worker thread, so the main thread is free
// to react to translation demand.
main_thread_worker_state = MainThreadWorkerState::Idle;
running += 1;
match token {
Ok(token) => {
tokens.push(token);

if main_thread_worker_state == MainThreadWorkerState::LLVMing {
// If the main thread token is used for LLVM work
// at the moment, we turn that thread into a regular
// LLVM worker thread, so the main thread is free
// to react to translation demand.
main_thread_worker_state = MainThreadWorkerState::Idle;
running += 1;
}
}
Err(e) => {
let msg = &format!("failed to acquire jobserver token: {}", e);
shared_emitter.fatal(msg);
// Exit the coordinator thread
panic!()
}
} else {
shared_emitter.fatal("failed to acquire jobserver token");
// Exit the coordinator thread
panic!()
}
}

Expand Down

0 comments on commit cacc31f

Please sign in to comment.