2 unstable releases
0.2.0 | May 5, 2024 |
---|---|
0.1.0 | Apr 29, 2024 |
#1713 in Embedded development
63 downloads per month
230KB
2.5K
SLoC
Read-write lock for lilos
This provides a read-write lock for use with lilos
.
See the API documentation for more.
lib.rs
:
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 typeT
and allows either multiple shared references, or one exclusive reference, but not both simultaneously.SharedGuard<T>
represents a shared reference to the data guarded by aRwLock
and 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 acrossawait
points, but you have to promise the library that the data is inherently cancel-safe (by using thelilos::util::CancelSafe
marker type).
See the docs on RwLock
for more details.
Dependencies
~2.5MB
~40K SLoC