Skip to content

Commit b491ddd

Browse files
committed
Update
1 parent cd314ab commit b491ddd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libstd/sync/rwlock.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ use sys_common::rwlock as sys;
6363
/// assert_eq!(*w, 6);
6464
/// } // write lock is dropped here
6565
/// ```
66-
/// # Panics
67-
///
68-
/// This function might panic when called if the lock is already held by the current thread.
6966
#[stable(feature = "rust1", since = "1.0.0")]
7067
pub struct RwLock<T: ?Sized> {
7168
inner: Box<sys::RWLock>,
@@ -139,6 +136,10 @@ impl<T: ?Sized> RwLock<T> {
139136
/// This function will return an error if the RwLock is poisoned. An RwLock
140137
/// is poisoned whenever a writer panics while holding an exclusive lock.
141138
/// The failure will occur immediately after the lock has been acquired.
139+
///
140+
/// # Panics
141+
///
142+
/// This function might panic when called if the lock is already held by the current thread.
142143
#[inline]
143144
#[stable(feature = "rust1", since = "1.0.0")]
144145
pub fn read(&self) -> LockResult<RwLockReadGuard<T>> {
@@ -191,6 +192,10 @@ impl<T: ?Sized> RwLock<T> {
191192
/// This function will return an error if the RwLock is poisoned. An RwLock
192193
/// is poisoned whenever a writer panics while holding an exclusive lock.
193194
/// An error will be returned when the lock is acquired.
195+
///
196+
/// # Panics
197+
///
198+
/// This function might panic when called if the lock is already held by the current thread.
194199
#[inline]
195200
#[stable(feature = "rust1", since = "1.0.0")]
196201
pub fn write(&self) -> LockResult<RwLockWriteGuard<T>> {

0 commit comments

Comments
 (0)