Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix code referencing RwLockWriteGuard
  • Loading branch information
ville-h committed Jan 4, 2015
1 parent 98e6d12 commit 44b3dde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libstd/sync/mod.rs
Expand Up @@ -22,7 +22,7 @@ pub use alloc::arc::{Arc, Weak};
pub use self::mutex::{Mutex, MutexGuard, StaticMutex};
pub use self::mutex::MUTEX_INIT;
pub use self::rwlock::{RwLock, StaticRwLock, RW_LOCK_INIT};
pub use self::rwlock::{RwLockReadGuard, RWLockWriteGuard};
pub use self::rwlock::{RwLockReadGuard, RwLockWriteGuard};
pub use self::condvar::{Condvar, StaticCondvar, CONDVAR_INIT};
pub use self::once::{Once, ONCE_INIT};
pub use self::semaphore::{Semaphore, SemaphoreGuard};
Expand Down
16 changes: 8 additions & 8 deletions src/libstd/sync/rwlock.rs
Expand Up @@ -199,9 +199,9 @@ impl<T: Send + Sync> RwLock<T> {
/// An error will be returned when the lock is acquired.
#[inline]
#[stable]
pub fn write(&self) -> LockResult<RWLockWriteGuard<T>> {
pub fn write(&self) -> LockResult<RwLockWriteGuard<T>> {
unsafe { self.inner.lock.write() }
RWLockWriteGuard::new(&*self.inner, &self.data)
RwLockWriteGuard::new(&*self.inner, &self.data)
}

/// Attempt to lock this rwlock with exclusive write access.
Expand All @@ -218,9 +218,9 @@ impl<T: Send + Sync> RwLock<T> {
/// acquired.
#[inline]
#[stable]
pub fn try_write(&self) -> TryLockResult<RWLockWriteGuard<T>> {
pub fn try_write(&self) -> TryLockResult<RwLockWriteGuard<T>> {
if unsafe { self.inner.lock.try_read() } {
Ok(try!(RWLockWriteGuard::new(&*self.inner, &self.data)))
Ok(try!(RwLockWriteGuard::new(&*self.inner, &self.data)))
} else {
Err(TryLockError::WouldBlock)
}
Expand Down Expand Up @@ -270,9 +270,9 @@ impl StaticRwLock {
/// See `RwLock::write`.
#[inline]
#[unstable = "may be merged with RwLock in the future"]
pub fn write(&'static self) -> LockResult<RWLockWriteGuard<'static, ()>> {
pub fn write(&'static self) -> LockResult<RwLockWriteGuard<'static, ()>> {
unsafe { self.lock.write() }
RWLockWriteGuard::new(self, &DUMMY.0)
RwLockWriteGuard::new(self, &DUMMY.0)
}

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

0 comments on commit 44b3dde

Please sign in to comment.