@@ -30,7 +30,7 @@ use sys_common::poison::{self, TryLockError, TryLockResult, LockResult};
30
30
///
31
31
/// The mutexes in this module implement a strategy called "poisoning" where a
32
32
/// mutex is considered poisoned whenever a thread panics while holding the
33
- /// lock . Once a mutex is poisoned, all other threads are unable to access the
33
+ /// mutex . Once a mutex is poisoned, all other threads are unable to access the
34
34
/// data by default as it is likely tainted (some invariant is not being
35
35
/// upheld).
36
36
///
@@ -115,7 +115,7 @@ pub struct Mutex<T: ?Sized> {
115
115
// Note that this mutex is in a *box*, not inlined into the struct itself.
116
116
// Once a native mutex has been used once, its address can never change (it
117
117
// can't be moved). This mutex type can be safely moved at any time, so to
118
- // ensure that the native mutex is used correctly we box the inner lock to
118
+ // ensure that the native mutex is used correctly we box the inner mutex to
119
119
// give it a constant address.
120
120
inner : Box < sys:: Mutex > ,
121
121
poison : poison:: Flag ,
@@ -183,7 +183,7 @@ impl<T: ?Sized> Mutex<T> {
183
183
/// Acquires a mutex, blocking the current thread until it is able to do so.
184
184
///
185
185
/// This function will block the local thread until it is available to acquire
186
- /// the mutex. Upon returning, the thread is the only thread with the mutex
186
+ /// the mutex. Upon returning, the thread is the only thread with the lock
187
187
/// held. An RAII guard is returned to allow scoped unlock of the lock. When
188
188
/// the guard goes out of scope, the mutex will be unlocked.
189
189
///
@@ -267,9 +267,9 @@ impl<T: ?Sized> Mutex<T> {
267
267
}
268
268
}
269
269
270
- /// Determines whether the lock is poisoned.
270
+ /// Determines whether the mutex is poisoned.
271
271
///
272
- /// If another thread is active, the lock can still become poisoned at any
272
+ /// If another thread is active, the mutex can still become poisoned at any
273
273
/// time. You should not trust a `false` value for program correctness
274
274
/// without additional synchronization.
275
275
///
@@ -312,7 +312,7 @@ impl<T: ?Sized> Mutex<T> {
312
312
#[ stable( feature = "mutex_into_inner" , since = "1.6.0" ) ]
313
313
pub fn into_inner ( self ) -> LockResult < T > where T : Sized {
314
314
// We know statically that there are no outstanding references to
315
- // `self` so there's no need to lock the inner lock .
315
+ // `self` so there's no need to lock the inner mutex .
316
316
//
317
317
// To get the inner value, we'd like to call `data.into_inner()`,
318
318
// but because `Mutex` impl-s `Drop`, we can't move out of it, so
@@ -353,7 +353,7 @@ impl<T: ?Sized> Mutex<T> {
353
353
#[ stable( feature = "mutex_get_mut" , since = "1.6.0" ) ]
354
354
pub fn get_mut ( & mut self ) -> LockResult < & mut T > {
355
355
// We know statically that there are no other references to `self`, so
356
- // there's no need to lock the inner lock .
356
+ // there's no need to lock the inner mutex .
357
357
let data = unsafe { & mut * self . data . get ( ) } ;
358
358
poison:: map_result ( self . poison . borrow ( ) , |_| data )
359
359
}
0 commit comments