Skip to content

Commit 35a1b91

Browse files
committed
Address comments
1 parent 892fed9 commit 35a1b91

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/librustc_data_structures/jobserver.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::{Condvar, Arc, Mutex};
44
use std::mem;
55

66
#[derive(Default)]
7-
pub struct LockedProxyData {
7+
struct LockedProxyData {
88
/// The number of free thread tokens, this may include the implicit token given to the process
99
free: usize,
1010

@@ -72,12 +72,15 @@ impl LockedProxyData {
7272
}
7373

7474
#[derive(Default)]
75-
pub struct ProxyData {
75+
struct ProxyData {
7676
lock: Mutex<LockedProxyData>,
7777
cond_var: Condvar,
7878
}
7979

80-
pub struct Proxy {
80+
/// A helper type which makes managing jobserver tokens easier.
81+
/// It also allows you to treat the implicit token given to the process
82+
/// in the same manner as requested tokens.
83+
struct Proxy {
8184
thread: Mutex<HelperThread>,
8285
data: Arc<ProxyData>,
8386
}
@@ -131,11 +134,11 @@ pub fn release_thread() {
131134
}
132135

133136
impl Proxy {
134-
pub fn release_token(&self) {
137+
fn release_token(&self) {
135138
self.data.lock.lock().unwrap().release_token(&self.data.cond_var);
136139
}
137140

138-
pub fn acquire_token(&self) {
141+
fn acquire_token(&self) {
139142
let mut data = self.data.lock.lock().unwrap();
140143
data.waiters += 1;
141144
if data.take_token(&self.thread) {

0 commit comments

Comments
 (0)