about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorNabeel Omer <nabeelkomer@gmail.com>2016-10-13 21:07:18 +0530
committerNabeel Omer <nabeelkomer@gmail.com>2016-10-13 21:07:18 +0530
commitb491ddd0f082c7e129ee581a0de3e54ebde9573a (patch)
tree0ccc229e7ea2b5043557250e3a55894582f341ae /src/libstd
parentcd314ab05834518dd20072684081af8afc9edb6c (diff)
downloadrust-b491ddd0f082c7e129ee581a0de3e54ebde9573a.tar.gz
rust-b491ddd0f082c7e129ee581a0de3e54ebde9573a.zip
Update
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sync/rwlock.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs
index c5a03f72e29..f08b7641521 100644
--- a/src/libstd/sync/rwlock.rs
+++ b/src/libstd/sync/rwlock.rs
@@ -63,9 +63,6 @@ use sys_common::rwlock as sys;
 ///     assert_eq!(*w, 6);
 /// } // write lock is dropped here
 /// ```
-/// # Panics
-///
-/// This function might panic when called if the lock is already held by the current thread.
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct RwLock<T: ?Sized> {
     inner: Box<sys::RWLock>,
@@ -139,6 +136,10 @@ impl<T: ?Sized> RwLock<T> {
     /// This function will return an error if the RwLock is poisoned. An RwLock
     /// is poisoned whenever a writer panics while holding an exclusive lock.
     /// The failure will occur immediately after the lock has been acquired.
+    ///
+    /// # Panics
+    ///
+    /// This function might panic when called if the lock is already held by the current thread.
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn read(&self) -> LockResult<RwLockReadGuard<T>> {
@@ -191,6 +192,10 @@ impl<T: ?Sized> RwLock<T> {
     /// This function will return an error if the RwLock is poisoned. An RwLock
     /// is poisoned whenever a writer panics while holding an exclusive lock.
     /// An error will be returned when the lock is acquired.
+    ///
+    /// # Panics
+    ///
+    /// This function might panic when called if the lock is already held by the current thread.
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn write(&self) -> LockResult<RwLockWriteGuard<T>> {