File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1- use jobserver:: { Acquired , Client , HelperThread } ;
1+ use jobserver:: { Acquired , HelperThread } ;
22use std:: {
33 env,
44 sync:: {
@@ -47,7 +47,8 @@ pub(crate) struct JobTokenServer {
4747}
4848
4949impl JobTokenServer {
50- pub ( crate ) fn new ( client : Client ) -> Result < Self , crate :: Error > {
50+ pub ( crate ) fn new ( ) -> Result < Self , crate :: Error > {
51+ let client = jobserver ( ) ;
5152 let ( tx, rx) = mpsc:: channel ( ) ;
5253 // Push the implicit token. Since JobTokens only give back what they got,
5354 // there should be at most one global implicit token in the wild.
@@ -77,7 +78,7 @@ impl JobTokenServer {
7778
7879/// Returns a suitable `jobserver::Client` used to coordinate
7980/// parallelism between build scripts.
80- pub ( super ) fn jobserver ( ) -> jobserver:: Client {
81+ fn jobserver ( ) -> jobserver:: Client {
8182 static INIT : Once = Once :: new ( ) ;
8283 static mut JOBSERVER : Option < jobserver:: Client > = None ;
8384
Original file line number Diff line number Diff line change @@ -1306,8 +1306,7 @@ impl Build {
13061306 }
13071307
13081308 // Limit our parallelism globally with a jobserver.
1309- let server = job_token:: jobserver ( ) ;
1310- // Reacquire our process's token on drop
1309+ let mut tokens = crate :: job_token:: JobTokenServer :: new ( ) ?;
13111310
13121311 // When compiling objects in parallel we do a few dirty tricks to speed
13131312 // things up:
@@ -1426,7 +1425,6 @@ impl Build {
14261425 } ;
14271426 }
14281427 } ) ?;
1429- let mut tokens = crate :: job_token:: JobTokenServer :: new ( server) ?;
14301428 for obj in objs {
14311429 let ( mut cmd, program) = self . create_compile_object_cmd ( obj) ?;
14321430 let token = tokens. acquire ( ) ;
You can’t perform that action at this time.
0 commit comments