File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,6 @@ use sys_common::rwlock as sys;
63
63
/// assert_eq!(*w, 6);
64
64
/// } // write lock is dropped here
65
65
/// ```
66
- /// # Panics
67
- ///
68
- /// This function might panic when called if the lock is already held by the current thread.
69
66
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
70
67
pub struct RwLock < T : ?Sized > {
71
68
inner : Box < sys:: RWLock > ,
@@ -139,6 +136,10 @@ impl<T: ?Sized> RwLock<T> {
139
136
/// This function will return an error if the RwLock is poisoned. An RwLock
140
137
/// is poisoned whenever a writer panics while holding an exclusive lock.
141
138
/// 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.
142
143
#[ inline]
143
144
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
144
145
pub fn read ( & self ) -> LockResult < RwLockReadGuard < T > > {
@@ -191,6 +192,10 @@ impl<T: ?Sized> RwLock<T> {
191
192
/// This function will return an error if the RwLock is poisoned. An RwLock
192
193
/// is poisoned whenever a writer panics while holding an exclusive lock.
193
194
/// 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.
194
199
#[ inline]
195
200
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
196
201
pub fn write ( & self ) -> LockResult < RwLockWriteGuard < T > > {
You can’t perform that action at this time.
0 commit comments