diff options
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/barrier.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sync/condvar.rs | 22 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/select.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sync/mutex.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/once.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 16 |
7 files changed, 27 insertions, 27 deletions
diff --git a/src/libstd/sync/barrier.rs b/src/libstd/sync/barrier.rs index ebf4d337749..34fcf6cdadd 100644 --- a/src/libstd/sync/barrier.rs +++ b/src/libstd/sync/barrier.rs @@ -49,7 +49,7 @@ struct BarrierState { pub struct BarrierWaitResult(bool); impl Barrier { - /// Create a new barrier that can block a given number of threads. + /// Creates a new barrier that can block a given number of threads. /// /// A barrier will block `n`-1 threads which call `wait` and then wake up /// all threads at once when the `n`th thread calls `wait`. @@ -65,7 +65,7 @@ impl Barrier { } } - /// Block the current thread until all threads has rendezvoused here. + /// Blocks the current thread until all threads has rendezvoused here. /// /// Barriers are re-usable after all threads have rendezvoused once, and can /// be used continuously. @@ -97,7 +97,7 @@ impl Barrier { } impl BarrierWaitResult { - /// Return whether this thread from `wait` is the "leader thread". + /// Returns whether this thread from `wait` is the "leader thread". /// /// Only one thread will have `true` returned from their result, all other /// threads will have `false` returned. diff --git a/src/libstd/sync/condvar.rs b/src/libstd/sync/condvar.rs index 654b33f1a57..fcb0d2c0b2d 100644 --- a/src/libstd/sync/condvar.rs +++ b/src/libstd/sync/condvar.rs @@ -102,7 +102,7 @@ impl Condvar { } } - /// Block the current thread until this condition variable receives a + /// Blocks the current thread until this condition variable receives a /// notification. /// /// This function will atomically unlock the mutex specified (represented by @@ -137,7 +137,7 @@ impl Condvar { } } - /// Wait on this condition variable for a notification, timing out after a + /// Waits on this condition variable for a notification, timing out after a /// specified duration. /// /// The semantics of this function are equivalent to `wait()` @@ -169,7 +169,7 @@ impl Condvar { self.wait_timeout_ms(guard, dur.num_milliseconds() as u32) } - /// Wait on this condition variable for a notification, timing out after a + /// Waits on this condition variable for a notification, timing out after a /// specified duration. /// /// The semantics of this function are equivalent to `wait_timeout` except @@ -189,7 +189,7 @@ impl Condvar { } } - /// Wake up one blocked thread on this condvar. + /// Wakes up one blocked thread on this condvar. /// /// If there is a blocked thread on this condition variable, then it will /// be woken up from its call to `wait` or `wait_timeout`. Calls to @@ -199,7 +199,7 @@ impl Condvar { #[stable(feature = "rust1", since = "1.0.0")] pub fn notify_one(&self) { unsafe { self.inner.inner.notify_one() } } - /// Wake up all blocked threads on this condvar. + /// Wakes up all blocked threads on this condvar. /// /// This method will ensure that any current waiters on the condition /// variable are awoken. Calls to `notify_all()` are not buffered in any @@ -218,7 +218,7 @@ impl Drop for Condvar { } impl StaticCondvar { - /// Block the current thread until this condition variable receives a + /// Blocks the current thread until this condition variable receives a /// notification. /// /// See `Condvar::wait`. @@ -239,7 +239,7 @@ impl StaticCondvar { } } - /// Wait on this condition variable for a notification, timing out after a + /// Waits on this condition variable for a notification, timing out after a /// specified duration. /// /// See `Condvar::wait_timeout`. @@ -260,7 +260,7 @@ impl StaticCondvar { } } - /// Wait on this condition variable for a notification, timing out after a + /// Waits on this condition variable for a notification, timing out after a /// specified duration. /// /// The implementation will repeatedly wait while the duration has not @@ -306,21 +306,21 @@ impl StaticCondvar { poison::map_result(guard_result, |g| (g, true)) } - /// Wake up one blocked thread on this condvar. + /// Wakes up one blocked thread on this condvar. /// /// See `Condvar::notify_one`. #[unstable(feature = "std_misc", reason = "may be merged with Condvar in the future")] pub fn notify_one(&'static self) { unsafe { self.inner.notify_one() } } - /// Wake up all blocked threads on this condvar. + /// Wakes up all blocked threads on this condvar. /// /// See `Condvar::notify_all`. #[unstable(feature = "std_misc", reason = "may be merged with Condvar in the future")] pub fn notify_all(&'static self) { unsafe { self.inner.notify_all() } } - /// Deallocate all resources associated with this static condvar. + /// Deallocates all resources associated with this static condvar. /// /// This method is unsafe to call as there is no guarantee that there are no /// active users of the condvar, and this also doesn't prevent any future diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 93b27b6ce9e..422439fadc1 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -750,7 +750,7 @@ impl<T> Receiver<T> { } } - /// Attempt to wait for a value on this receiver, returning an error if the + /// Attempts to wait for a value on this receiver, returning an error if the /// corresponding channel has hung up. /// /// This function will always block the current thread if there is no data diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index b509b3472ee..b8ad92841f2 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -254,11 +254,11 @@ impl Select { } impl<'rx, T: Send> Handle<'rx, T> { - /// Retrieve the id of this handle. + /// Retrieves the id of this handle. #[inline] pub fn id(&self) -> usize { self.id } - /// Block to receive a value on the underlying receiver, returning `Some` on + /// Blocks to receive a value on the underlying receiver, returning `Some` on /// success or `None` if the channel disconnects. This function has the same /// semantics as `Receiver.recv` pub fn recv(&mut self) -> Result<T, RecvError> { self.rx.recv() } diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 46fb20cd6a2..7896870ea07 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -232,7 +232,7 @@ impl<T> Mutex<T> { } } - /// Determine whether the lock is poisoned. + /// Determines whether the lock is poisoned. /// /// If another thread is active, the lock can still become poisoned at any /// time. You should not trust a `false` value for program correctness diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 258cf1d38a8..948965f5efa 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -51,7 +51,7 @@ pub const ONCE_INIT: Once = Once { }; impl Once { - /// Perform an initialization routine once and only once. The given closure + /// Performs an initialization routine once and only once. The given closure /// will be executed if this is the first time `call_once` has been called, /// and otherwise the routine will *not* be invoked. /// diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index eb6d46a5dda..1ea92d5eff7 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -169,7 +169,7 @@ impl<T> RwLock<T> { RwLockReadGuard::new(&*self.inner, &self.data) } - /// Attempt to acquire this lock with shared read access. + /// Attempts to acquire this lock with shared read access. /// /// This function will never block and will return immediately if `read` /// would otherwise succeed. Returns `Some` of an RAII guard which will @@ -194,7 +194,7 @@ impl<T> RwLock<T> { } } - /// Lock this rwlock with exclusive write access, blocking the current + /// Locks this rwlock with exclusive write access, blocking the current /// thread until it can be acquired. /// /// This function will not return while other writers or other readers @@ -215,7 +215,7 @@ impl<T> RwLock<T> { RwLockWriteGuard::new(&*self.inner, &self.data) } - /// Attempt to lock this rwlock with exclusive write access. + /// Attempts to lock this rwlock with exclusive write access. /// /// This function does not ever block, and it will return `None` if a call /// to `write` would otherwise block. If successful, an RAII guard is @@ -237,7 +237,7 @@ impl<T> RwLock<T> { } } - /// Determine whether the lock is poisoned. + /// Determines whether the lock is poisoned. /// /// If another thread is active, the lock can still become poisoned at any /// time. You should not trust a `false` value for program correctness @@ -287,7 +287,7 @@ impl StaticRwLock { RwLockReadGuard::new(self, &DUMMY.0) } - /// Attempt to acquire this lock with shared read access. + /// Attempts to acquire this lock with shared read access. /// /// See `RwLock::try_read`. #[inline] @@ -302,7 +302,7 @@ impl StaticRwLock { } } - /// Lock this rwlock with exclusive write access, blocking the current + /// Locks this rwlock with exclusive write access, blocking the current /// thread until it can be acquired. /// /// See `RwLock::write`. @@ -314,7 +314,7 @@ impl StaticRwLock { RwLockWriteGuard::new(self, &DUMMY.0) } - /// Attempt to lock this rwlock with exclusive write access. + /// Attempts to lock this rwlock with exclusive write access. /// /// See `RwLock::try_write`. #[inline] @@ -329,7 +329,7 @@ impl StaticRwLock { } } - /// Deallocate all resources associated with this static lock. + /// Deallocates all resources associated with this static lock. /// /// This method is unsafe to call as there is no guarantee that there are no /// active users of the lock, and this also doesn't prevent any future users |
