Struct sync::RwLock [−][src]
pub struct RwLock<T: ?Sized, Lock> { /* fields omitted */ }
Mutual exclusionary primitive
Methods
impl<T, Lock: Lock> RwLock<T, Lock>
[src]
impl<T, Lock: Lock> RwLock<T, Lock>
impl<T: ?Sized, Lock: Lock> RwLock<T, Lock>
[src]
impl<T: ?Sized, Lock: Lock> RwLock<T, Lock>
pub fn lock(&self) -> Guard<T, Lock>
[src]
pub fn lock(&self) -> Guard<T, Lock>
Take a reference to the guarded value, blocking if another thread is already holding an exclusive reference.
pub fn lock_mut(&self) -> GuardMut<T, Lock>
[src]
pub fn lock_mut(&self) -> GuardMut<T, Lock>
Take an exclusive reference to the guarded value, blocking if another thread is already holding a reference.
pub fn try_lock(&self) -> Option<Guard<T, Lock>>
[src]
pub fn try_lock(&self) -> Option<Guard<T, Lock>>
Take a reference to the guarded value, returning None
if another thread is already
holding an exclusive reference.
pub fn try_lock_mut(&self) -> Option<GuardMut<T, Lock>>
[src]
pub fn try_lock_mut(&self) -> Option<GuardMut<T, Lock>>
Take an exclusive reference to the guarded value, returning None
if another thread is
already holding a reference.