Skip to content

Commit 44b3dde

Browse files
committed
fix code referencing RwLockWriteGuard
1 parent 98e6d12 commit 44b3dde

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/libstd/sync/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use alloc::arc::{Arc, Weak};
2222
pub use self::mutex::{Mutex, MutexGuard, StaticMutex};
2323
pub use self::mutex::MUTEX_INIT;
2424
pub use self::rwlock::{RwLock, StaticRwLock, RW_LOCK_INIT};
25-
pub use self::rwlock::{RwLockReadGuard, RWLockWriteGuard};
25+
pub use self::rwlock::{RwLockReadGuard, RwLockWriteGuard};
2626
pub use self::condvar::{Condvar, StaticCondvar, CONDVAR_INIT};
2727
pub use self::once::{Once, ONCE_INIT};
2828
pub use self::semaphore::{Semaphore, SemaphoreGuard};

src/libstd/sync/rwlock.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ impl<T: Send + Sync> RwLock<T> {
199199
/// An error will be returned when the lock is acquired.
200200
#[inline]
201201
#[stable]
202-
pub fn write(&self) -> LockResult<RWLockWriteGuard<T>> {
202+
pub fn write(&self) -> LockResult<RwLockWriteGuard<T>> {
203203
unsafe { self.inner.lock.write() }
204-
RWLockWriteGuard::new(&*self.inner, &self.data)
204+
RwLockWriteGuard::new(&*self.inner, &self.data)
205205
}
206206

207207
/// Attempt to lock this rwlock with exclusive write access.
@@ -218,9 +218,9 @@ impl<T: Send + Sync> RwLock<T> {
218218
/// acquired.
219219
#[inline]
220220
#[stable]
221-
pub fn try_write(&self) -> TryLockResult<RWLockWriteGuard<T>> {
221+
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<T>> {
222222
if unsafe { self.inner.lock.try_read() } {
223-
Ok(try!(RWLockWriteGuard::new(&*self.inner, &self.data)))
223+
Ok(try!(RwLockWriteGuard::new(&*self.inner, &self.data)))
224224
} else {
225225
Err(TryLockError::WouldBlock)
226226
}
@@ -270,9 +270,9 @@ impl StaticRwLock {
270270
/// See `RwLock::write`.
271271
#[inline]
272272
#[unstable = "may be merged with RwLock in the future"]
273-
pub fn write(&'static self) -> LockResult<RWLockWriteGuard<'static, ()>> {
273+
pub fn write(&'static self) -> LockResult<RwLockWriteGuard<'static, ()>> {
274274
unsafe { self.lock.write() }
275-
RWLockWriteGuard::new(self, &DUMMY.0)
275+
RwLockWriteGuard::new(self, &DUMMY.0)
276276
}
277277

278278
/// Attempt to lock this rwlock with exclusive write access.
@@ -281,9 +281,9 @@ impl StaticRwLock {
281281
#[inline]
282282
#[unstable = "may be merged with RwLock in the future"]
283283
pub fn try_write(&'static self)
284-
-> TryLockResult<RWLockWriteGuard<'static, ()>> {
284+
-> TryLockResult<RwLockWriteGuard<'static, ()>> {
285285
if unsafe { self.lock.try_write() } {
286-
Ok(try!(RWLockWriteGuard::new(self, &DUMMY.0)))
286+
Ok(try!(RwLockWriteGuard::new(self, &DUMMY.0)))
287287
} else {
288288
Err(TryLockError::WouldBlock)
289289
}

0 commit comments

Comments
 (0)