File tree 2 files changed +5
-6
lines changed
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 } ;
2
2
use std:: {
3
3
env,
4
4
sync:: {
@@ -47,7 +47,8 @@ pub(crate) struct JobTokenServer {
47
47
}
48
48
49
49
impl 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 ( ) ;
51
52
let ( tx, rx) = mpsc:: channel ( ) ;
52
53
// Push the implicit token. Since JobTokens only give back what they got,
53
54
// there should be at most one global implicit token in the wild.
@@ -77,7 +78,7 @@ impl JobTokenServer {
77
78
78
79
/// Returns a suitable `jobserver::Client` used to coordinate
79
80
/// parallelism between build scripts.
80
- pub ( super ) fn jobserver ( ) -> jobserver:: Client {
81
+ fn jobserver ( ) -> jobserver:: Client {
81
82
static INIT : Once = Once :: new ( ) ;
82
83
static mut JOBSERVER : Option < jobserver:: Client > = None ;
83
84
Original file line number Diff line number Diff line change @@ -1306,8 +1306,7 @@ impl Build {
1306
1306
}
1307
1307
1308
1308
// 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 ( ) ?;
1311
1310
1312
1311
// When compiling objects in parallel we do a few dirty tricks to speed
1313
1312
// things up:
@@ -1426,7 +1425,6 @@ impl Build {
1426
1425
} ;
1427
1426
}
1428
1427
} ) ?;
1429
- let mut tokens = crate :: job_token:: JobTokenServer :: new ( server) ?;
1430
1428
for obj in objs {
1431
1429
let ( mut cmd, program) = self . create_compile_object_cmd ( obj) ?;
1432
1430
let token = tokens. acquire ( ) ;
You can’t perform that action at this time.
0 commit comments