Release a previously acquired read lock.
WARNING: Failing to call readUnlock() after readLock() will cause deadlock.
Attempt to acquire a read lock without waiting. Returns true if successful.
True if the read lock was acquired, false otherwise.
Attempt to acquire a write lock without waiting. Returns true if successful.
True if the write lock was acquired, false otherwise.
Downgrade a held write lock to a read lock. The caller must already hold the write lock.
Release a previously acquired write lock.
WARNING: Failing to call writeUnlock() after writeLock() will cause deadlock.
An asynchronous read-write lock (RwLock) for coordinating access to shared resources.
Allows multiple concurrent readers or exclusive access for a single writer.
All lock/unlock operations are asynchronous and must be awaited.
WARNING: Deadlock is possible if:
Best practices:
Example usage: await rwLock.readLock(); try { // read shared resource } finally { rwLock.readUnlock(); }