Struct rculock::RcuLock
[−]
[src]
pub struct RcuLock<T: Clone> { /* fields omitted */ }
Methods
impl<T: Clone> RcuLock<T>
[src]
fn new(target: T) -> RcuLock<T>
Create a new RcuLock.
fn read(&self) -> Arc<T>
Acquire a read handle to the RcuLock
. This operation never blocks.
fn write(&self) -> RcuGuard<T>
Acquire an exclusive write handle to the RcuLock
, protected by an RcuGuard
.
This operation blocks if another RcuGuard
is currently alive, i.e.
the RcuLock
has already handed one out to another writer.
Clones the data protected by the RcuLock
, which can be expensive.