Build Status Current Crates.io Version Document

RcuCell

A lockless rcu cell implementation that can be used safely in multithread context.

Features

Usage

```rust fn singlethread() { let t = RcuCell::new(Some(10)); let x = t.read(); let y = t.read(); t.trylock().unwrap().update(None); let z = t.read(); let a = z.clone(); drop(t); // t can be dropped before reader asserteq!(x.map(|v| *v), Some(10)); asserteq!(y.map(|v| *v), Some(10)); asserteq!(z.map(|v| *v), None); asserteq!(a.map(|v| *v), None); }

fn single_thread_clone() {
    let t = RcuCell::new(Some(10));
    let t1 = t.clone();
    assert!(t1.read().map(|v| *v) == Some(10));
    t1.try_lock().unwrap().update(Some(5));
    assert!(t.read().map(|v| *v) == Some(5));
}

```