Skip to content

Commit

Permalink
Correct a condition to request jobserver tokens
Browse files Browse the repository at this point in the history
This looks like it was a bug ever present from the original
implementation of a GNU jobserver in rust-lang#4110, but we currently
unconditionally request a token is allocated for any job we pull off our
job queue. Rather we only need to request tokens for everything but the
first job because we already have an implicit token for that job.
  • Loading branch information
alexcrichton committed Apr 22, 2019
1 parent 21ea254 commit b36594d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
// request a token.
while let Some((key, job)) = self.queue.dequeue() {
queue.push((key, job));
if !self.active.is_empty() || !queue.is_empty() {
if self.active.len() + queue.len() > 1 {
jobserver_helper.request_token();
}
}
Expand Down

0 comments on commit b36594d

Please sign in to comment.