1 unstable release
0.1.0 | Jul 31, 2021 |
---|
#1040 in Asynchronous
27KB
539 lines
fut_rwlock
fut_rwlock
FutRwLock
returns a Future-wrapped locks to a read-write lock synchronization primitive.
It is a wrapper around the std library synchronization primitive std::sync::RwLock.
- The FutRwLock does not block the calling thread that requests a lock.
- Any call to [read]FutRwLock::read/write returns an asynchronous Future
that must be
await
ed even if it resolves immediately. If a lock isn't awaited, it does nothing. - To attempt to acquire an Option-wrapped read or write lock synchronously/immediately use the try_read_now or try_write_now. synchronous methods.
- It was made to be suitable for use in single-threaded wasm environments without running into errors when the environment tries to block upon accessing a synchronization primitive.
- Locks are alloted to callers in request order.
License: Apache-2.0
Dependencies
~1MB
~16K SLoC