2 unstable releases
| 0.2.0 | May 5, 2024 |
|---|---|
| 0.1.0 | Apr 29, 2024 |
#371 in #os
63 downloads per month
230KB
2.5K
SLoC
A read-write lock for use with lilos.
There's a small family of related types in this here crate:
RwLock<T>contains some data of typeTand allows either multiple shared references, or one exclusive reference, but not both simultaneously.SharedGuard<T>represents a shared reference to the data guarded by aRwLockand allows access to it (viaDeref).ActionPermit<T>represents an exclusive reference to the data guarded by aRwLock, but once you start doing something that can modify the data, you can'tawait, to ensure that cancellation won't corrupt the guarded data.ExclusiveGuard<T>allows arbitrary exclusive access, even acrossawaitpoints, but you have to promise the library that the data is inherently cancel-safe (by using thelilos::util::CancelSafemarker type).
See the docs on RwLock for more details.
Read-write lock for lilos
This provides a read-write lock for use with lilos.
See the API documentation for more.
Dependencies
~2.5MB
~38K SLoC