Struct loom::sync::RwLock [−][src]
pub struct RwLock<T> { /* fields omitted */ }
Expand description
Mock implementation of std::sync::RwLock
Implementations
Locks this rwlock with shared read access, blocking the current thread until it can be acquired.
The calling thread will be blocked until there are no more writers which hold the lock. There may be other readers currently inside the lock when this method returns. This method does not provide any guarantees with respect to the ordering of whether contentious readers or writers will acquire the lock first.
Attempts to acquire this rwlock with shared read access.
If the access could not be granted at this time, then Err is returned. Otherwise, an RAII guard is returned which will release the shared access when it is dropped.
This function does not block.
Locks this rwlock with exclusive write access, blocking the current thread until it can be acquired.
This function will not return while other writers or other readers currently have access to the lock.
Attempts to lock this rwlock with exclusive write access.
If the lock could not be acquired at this time, then Err is returned. Otherwise, an RAII guard is returned which will release the lock when it is dropped.
This function does not block.
Consumes this RwLock
, returning the underlying data.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for RwLock<T>
impl<T> UnwindSafe for RwLock<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more