Skip to content

Commit f67184f

Browse files
committed
Consistently write RwLock
Before the documentation sometimes referred to an "rwlock" and sometimes to "`RwLock`".
1 parent 17e8752 commit f67184f

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

library/std/src/sync/rwlock.rs

+32-31
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<T> RwLock<T> {
166166
}
167167

168168
impl<T: ?Sized> RwLock<T> {
169-
/// Locks this rwlock with shared read access, blocking the current thread
169+
/// Locks this `RwLock` with shared read access, blocking the current thread
170170
/// until it can be acquired.
171171
///
172172
/// The calling thread will be blocked until there are no more writers which
@@ -180,9 +180,10 @@ impl<T: ?Sized> RwLock<T> {
180180
///
181181
/// # Errors
182182
///
183-
/// This function will return an error if the RwLock is poisoned. An RwLock
184-
/// is poisoned whenever a writer panics while holding an exclusive lock.
185-
/// The failure will occur immediately after the lock has been acquired.
183+
/// This function will return an error if the `RwLock` is poisoned. An
184+
/// `RwLock` is poisoned whenever a writer panics while holding an exclusive
185+
/// lock. The failure will occur immediately after the lock has been
186+
/// acquired.
186187
///
187188
/// # Panics
188189
///
@@ -214,7 +215,7 @@ impl<T: ?Sized> RwLock<T> {
214215
}
215216
}
216217

217-
/// Attempts to acquire this rwlock with shared read access.
218+
/// Attempts to acquire this `RwLock` with shared read access.
218219
///
219220
/// If the access could not be granted at this time, then `Err` is returned.
220221
/// Otherwise, an RAII guard is returned which will release the shared access
@@ -227,13 +228,13 @@ impl<T: ?Sized> RwLock<T> {
227228
///
228229
/// # Errors
229230
///
230-
/// This function will return the [`Poisoned`] error if the RwLock is poisoned.
231-
/// An RwLock is poisoned whenever a writer panics while holding an exclusive
232-
/// lock. `Poisoned` will only be returned if the lock would have otherwise been
233-
/// acquired.
231+
/// This function will return the [`Poisoned`] error if the `RwLock` is
232+
/// poisoned. An `RwLock` is poisoned whenever a writer panics while holding
233+
/// an exclusive lock. `Poisoned` will only be returned if the lock would
234+
/// have otherwise been acquired.
234235
///
235-
/// This function will return the [`WouldBlock`] error if the RwLock could not
236-
/// be acquired because it was already locked exclusively.
236+
/// This function will return the [`WouldBlock`] error if the `RwLock` could
237+
/// not be acquired because it was already locked exclusively.
237238
///
238239
/// [`Poisoned`]: TryLockError::Poisoned
239240
/// [`WouldBlock`]: TryLockError::WouldBlock
@@ -262,20 +263,20 @@ impl<T: ?Sized> RwLock<T> {
262263
}
263264
}
264265

265-
/// Locks this rwlock with exclusive write access, blocking the current
266+
/// Locks this `RwLock` with exclusive write access, blocking the current
266267
/// thread until it can be acquired.
267268
///
268269
/// This function will not return while other writers or other readers
269270
/// currently have access to the lock.
270271
///
271-
/// Returns an RAII guard which will drop the write access of this rwlock
272+
/// Returns an RAII guard which will drop the write access of this `RwLock`
272273
/// when dropped.
273274
///
274275
/// # Errors
275276
///
276-
/// This function will return an error if the RwLock is poisoned. An RwLock
277-
/// is poisoned whenever a writer panics while holding an exclusive lock.
278-
/// An error will be returned when the lock is acquired.
277+
/// This function will return an error if the `RwLock` is poisoned. An
278+
/// `RwLock` is poisoned whenever a writer panics while holding an exclusive
279+
/// lock. An error will be returned when the lock is acquired.
279280
///
280281
/// # Panics
281282
///
@@ -302,7 +303,7 @@ impl<T: ?Sized> RwLock<T> {
302303
}
303304
}
304305

305-
/// Attempts to lock this rwlock with exclusive write access.
306+
/// Attempts to lock this `RwLock` with exclusive write access.
306307
///
307308
/// If the lock could not be acquired at this time, then `Err` is returned.
308309
/// Otherwise, an RAII guard is returned which will release the lock when
@@ -315,13 +316,13 @@ impl<T: ?Sized> RwLock<T> {
315316
///
316317
/// # Errors
317318
///
318-
/// This function will return the [`Poisoned`] error if the RwLock is
319-
/// poisoned. An RwLock is poisoned whenever a writer panics while holding
320-
/// an exclusive lock. `Poisoned` will only be returned if the lock would have
321-
/// otherwise been acquired.
319+
/// This function will return the [`Poisoned`] error if the `RwLock` is
320+
/// poisoned. An `RwLock` is poisoned whenever a writer panics while holding
321+
/// an exclusive lock. `Poisoned` will only be returned if the lock would
322+
/// have otherwise been acquired.
322323
///
323-
/// This function will return the [`WouldBlock`] error if the RwLock could not
324-
/// be acquired because it was already locked exclusively.
324+
/// This function will return the [`WouldBlock`] error if the `RwLock` could
325+
/// not be acquired because it was already locked exclusively.
325326
///
326327
/// [`Poisoned`]: TryLockError::Poisoned
327328
/// [`WouldBlock`]: TryLockError::WouldBlock
@@ -421,10 +422,10 @@ impl<T: ?Sized> RwLock<T> {
421422
///
422423
/// # Errors
423424
///
424-
/// This function will return an error if the RwLock is poisoned. An RwLock
425-
/// is poisoned whenever a writer panics while holding an exclusive lock. An
426-
/// error will only be returned if the lock would have otherwise been
427-
/// acquired.
425+
/// This function will return an error if the `RwLock` is poisoned. An
426+
/// `RwLock` is poisoned whenever a writer panics while holding an exclusive
427+
/// lock. An error will only be returned if the lock would have otherwise
428+
/// been acquired.
428429
///
429430
/// # Examples
430431
///
@@ -454,10 +455,10 @@ impl<T: ?Sized> RwLock<T> {
454455
///
455456
/// # Errors
456457
///
457-
/// This function will return an error if the RwLock is poisoned. An RwLock
458-
/// is poisoned whenever a writer panics while holding an exclusive lock. An
459-
/// error will only be returned if the lock would have otherwise been
460-
/// acquired.
458+
/// This function will return an error if the `RwLock` is poisoned. An
459+
/// `RwLock` is poisoned whenever a writer panics while holding an exclusive
460+
/// lock. An error will only be returned if the lock would have otherwise
461+
/// been acquired.
461462
///
462463
/// # Examples
463464
///

0 commit comments

Comments
 (0)