File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -977,6 +977,7 @@ impl Build {
977
977
// possible as soon as any compilation fails to ensure that errors get
978
978
// out to the user as fast as possible.
979
979
let server = jobserver ( ) ;
980
+ server. release_raw ( ) ?; // release our process's token which we'll reacquire in the loop
980
981
let error = AtomicBool :: new ( false ) ;
981
982
let mut threads = Vec :: new ( ) ;
982
983
for obj in objs {
@@ -1008,6 +1009,10 @@ impl Build {
1008
1009
}
1009
1010
}
1010
1011
1012
+ // Reacquire our process's token before we proceed, which we released
1013
+ // before entering the loop above.
1014
+ server. release_raw ( ) ?;
1015
+
1011
1016
return Ok ( ( ) ) ;
1012
1017
1013
1018
/// Shared state from the parent thread to the child thread. This
@@ -1053,7 +1058,12 @@ impl Build {
1053
1058
parallelism = amt;
1054
1059
}
1055
1060
}
1056
- jobserver:: Client :: new ( parallelism) . expect ( "failed to create jobserver" )
1061
+
1062
+ // If we create our own jobserver then be sure to reserve one token
1063
+ // for ourselves.
1064
+ let client = jobserver:: Client :: new ( parallelism) . expect ( "failed to create jobserver" ) ;
1065
+ client. acquire_raw ( ) . expect ( "failed to acquire initial" ) ;
1066
+ return client;
1057
1067
}
1058
1068
1059
1069
struct JoinOnDrop ( Option < thread:: JoinHandle < Result < ( ) , Error > > > ) ;
You can’t perform that action at this time.
0 commit comments