about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-01-31 17:00:06 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2019-03-01 01:15:38 +0100
commit35a1b91c4b4153027a722a267ba0bcdfec6d2bfe (patch)
tree8130859eb54d58f20c3afbe9762820c86b84bc5f /src
parent892fed9d08e7392ad04fb4351e88bff416f6a2d4 (diff)
downloadrust-35a1b91c4b4153027a722a267ba0bcdfec6d2bfe.tar.gz
rust-35a1b91c4b4153027a722a267ba0bcdfec6d2bfe.zip
Address comments
Diffstat (limited to 'src')
-rw-r--r--src/librustc_data_structures/jobserver.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/librustc_data_structures/jobserver.rs b/src/librustc_data_structures/jobserver.rs
index c85cdfbdcd8..48ac8125a0d 100644
--- a/src/librustc_data_structures/jobserver.rs
+++ b/src/librustc_data_structures/jobserver.rs
@@ -4,7 +4,7 @@ use std::sync::{Condvar, Arc, Mutex};
 use std::mem;
 
 #[derive(Default)]
-pub struct LockedProxyData {
+struct LockedProxyData {
     /// The number of free thread tokens, this may include the implicit token given to the process
     free: usize,
 
@@ -72,12 +72,15 @@ impl LockedProxyData {
 }
 
 #[derive(Default)]
-pub struct ProxyData {
+struct ProxyData {
     lock: Mutex<LockedProxyData>,
     cond_var: Condvar,
 }
 
-pub struct Proxy {
+/// A helper type which makes managing jobserver tokens easier.
+/// It also allows you to treat the implicit token given to the process
+/// in the same manner as requested tokens.
+struct Proxy {
     thread: Mutex<HelperThread>,
     data: Arc<ProxyData>,
 }
@@ -131,11 +134,11 @@ pub fn release_thread() {
 }
 
 impl Proxy {
-    pub fn release_token(&self) {
+    fn release_token(&self) {
         self.data.lock.lock().unwrap().release_token(&self.data.cond_var);
     }
 
-    pub fn acquire_token(&self) {
+    fn acquire_token(&self) {
         let mut data = self.data.lock.lock().unwrap();
         data.waiters += 1;
         if data.take_token(&self.thread) {