Working version
This commit is contained in:
@@ -1,2 +1,19 @@
|
||||
# access-cell
|
||||
A synchronous, single-threaded Mutex<T> anti-locking system
|
||||
A synchronous, single-threaded Mutex<T> anti-locking system
|
||||
|
||||
```rust
|
||||
let value = Arc::new(AccessCell::new(0));
|
||||
|
||||
value.access({
|
||||
let value = value.clone();
|
||||
|
||||
move |_| {
|
||||
// normally this would cause a deadlock
|
||||
value.access(|v| {
|
||||
*v = 10;
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
assert_eq!(*value.access_ref(), 10);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user