rename std::sync::RWLockWriteGuard to RwLockWriteGuard

This commit is contained in:
ville-h 2015-01-04 12:36:27 +02:00
parent 956cab6f97
commit 98e6d12017
1 changed files with 7 additions and 7 deletions

View File

@ -120,7 +120,7 @@ pub struct RwLockReadGuard<'a, T: 'a> {
/// dropped. /// dropped.
#[must_use] #[must_use]
#[stable] #[stable]
pub struct RWLockWriteGuard<'a, T: 'a> { pub struct RwLockWriteGuard<'a, T: 'a> {
__lock: &'a StaticRwLock, __lock: &'a StaticRwLock,
__data: &'a UnsafeCell<T>, __data: &'a UnsafeCell<T>,
__poison: poison::Guard, __poison: poison::Guard,
@ -313,11 +313,11 @@ impl<'rwlock, T> RwLockReadGuard<'rwlock, T> {
}) })
} }
} }
impl<'rwlock, T> RWLockWriteGuard<'rwlock, T> { impl<'rwlock, T> RwLockWriteGuard<'rwlock, T> {
fn new(lock: &'rwlock StaticRwLock, data: &'rwlock UnsafeCell<T>) fn new(lock: &'rwlock StaticRwLock, data: &'rwlock UnsafeCell<T>)
-> LockResult<RWLockWriteGuard<'rwlock, T>> { -> LockResult<RwLockWriteGuard<'rwlock, T>> {
poison::map_result(lock.poison.borrow(), |guard| { poison::map_result(lock.poison.borrow(), |guard| {
RWLockWriteGuard { RwLockWriteGuard {
__lock: lock, __lock: lock,
__data: data, __data: data,
__poison: guard, __poison: guard,
@ -332,12 +332,12 @@ impl<'rwlock, T> Deref for RwLockReadGuard<'rwlock, T> {
fn deref(&self) -> &T { unsafe { &*self.__data.get() } } fn deref(&self) -> &T { unsafe { &*self.__data.get() } }
} }
impl<'rwlock, T> Deref for RWLockWriteGuard<'rwlock, T> { impl<'rwlock, T> Deref for RwLockWriteGuard<'rwlock, T> {
type Target = T; type Target = T;
fn deref(&self) -> &T { unsafe { &*self.__data.get() } } fn deref(&self) -> &T { unsafe { &*self.__data.get() } }
} }
impl<'rwlock, T> DerefMut for RWLockWriteGuard<'rwlock, T> { impl<'rwlock, T> DerefMut for RwLockWriteGuard<'rwlock, T> {
fn deref_mut(&mut self) -> &mut T { fn deref_mut(&mut self) -> &mut T {
unsafe { &mut *self.__data.get() } unsafe { &mut *self.__data.get() }
} }
@ -351,7 +351,7 @@ impl<'a, T> Drop for RwLockReadGuard<'a, T> {
} }
#[unsafe_destructor] #[unsafe_destructor]
impl<'a, T> Drop for RWLockWriteGuard<'a, T> { impl<'a, T> Drop for RwLockWriteGuard<'a, T> {
fn drop(&mut self) { fn drop(&mut self) {
self.__lock.poison.done(&self.__poison); self.__lock.poison.done(&self.__poison);
unsafe { self.__lock.lock.write_unlock(); } unsafe { self.__lock.lock.write_unlock(); }