diff options
| author | ville-h <ville3.14159@gmail.com> | 2015-01-04 11:45:31 +0200 |
|---|---|---|
| committer | ville-h <ville3.14159@gmail.com> | 2015-01-04 11:45:31 +0200 |
| commit | 956cab6f97c1841e6f3f00acb6386f07eddfc25e (patch) | |
| tree | c4c203647ea752c1f180d348b08726030d788c13 /src/libstd/sync | |
| parent | 2dcbdc1edac50af0f1a2796b1dfe2dd082f8190c (diff) | |
| download | rust-956cab6f97c1841e6f3f00acb6386f07eddfc25e.tar.gz rust-956cab6f97c1841e6f3f00acb6386f07eddfc25e.zip | |
fix code referencing RwLockReadGuard
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs index 3bb0e257577..71ff3c7d172 100644 --- a/src/libstd/sync/mod.rs +++ b/src/libstd/sync/mod.rs @@ -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}; diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 37b9f5dc68d..0a8bf6f0aa7 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -153,9 +153,9 @@ impl<T: Send + Sync> RwLock<T> { /// The failure will occur immediately after the lock has been acquired. #[inline] #[stable] - pub fn read(&self) -> LockResult<RWLockReadGuard<T>> { + pub fn read(&self) -> LockResult<RwLockReadGuard<T>> { unsafe { self.inner.lock.read() } - RWLockReadGuard::new(&*self.inner, &self.data) + RwLockReadGuard::new(&*self.inner, &self.data) } /// Attempt to acquire this lock with shared read access. @@ -175,9 +175,9 @@ impl<T: Send + Sync> RwLock<T> { /// acquired. #[inline] #[stable] - pub fn try_read(&self) -> TryLockResult<RWLockReadGuard<T>> { + pub fn try_read(&self) -> TryLockResult<RwLockReadGuard<T>> { if unsafe { self.inner.lock.try_read() } { - Ok(try!(RWLockReadGuard::new(&*self.inner, &self.data))) + Ok(try!(RwLockReadGuard::new(&*self.inner, &self.data))) } else { Err(TryLockError::WouldBlock) } @@ -245,9 +245,9 @@ impl StaticRwLock { /// See `RwLock::read`. #[inline] #[unstable = "may be merged with RwLock in the future"] - pub fn read(&'static self) -> LockResult<RWLockReadGuard<'static, ()>> { + pub fn read(&'static self) -> LockResult<RwLockReadGuard<'static, ()>> { unsafe { self.lock.read() } - RWLockReadGuard::new(self, &DUMMY.0) + RwLockReadGuard::new(self, &DUMMY.0) } /// Attempt to acquire this lock with shared read access. @@ -256,9 +256,9 @@ impl StaticRwLock { #[inline] #[unstable = "may be merged with RwLock in the future"] pub fn try_read(&'static self) - -> TryLockResult<RWLockReadGuard<'static, ()>> { + -> TryLockResult<RwLockReadGuard<'static, ()>> { if unsafe { self.lock.try_read() } { - Ok(try!(RWLockReadGuard::new(self, &DUMMY.0))) + Ok(try!(RwLockReadGuard::new(self, &DUMMY.0))) } else { Err(TryLockError::WouldBlock) } |
