Working version

This commit is contained in:
2026-01-31 12:25:19 +01:00
parent f468f06899
commit 51d7b6c5a8
2 changed files with 84 additions and 9 deletions
+18 -1
View File
@@ -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);
```