Optional
options: ReadWriteLockOptionsOptional
timeout: numberThe optional maximum time to wait, in milliseconds.
A promise that's resolved with the acquired read lock. If a write lock is already held, the promise will not be resolved until the write lock is released. If other read locks are already held and there are no pending write locks, the promise is resolved immediately. Otherwise, the fairness determines whether or not the promise is resolved immediately or not.
If a timeout is given and it expires, the promise will be rejected.
Acquires a write lock.
Optional
timeout: numberThe optional maximum time to wait, in milliseconds.
A promise that's resolved with the acquired write lock. If a read or write lock is already held, the promise will not be resolved until all locks are released.
If a timeout is given and it expires, the promise will be rejected.
The number of promises returned by acquireReadLock that have not yet been resolved.
The number of promises returned by acquireWriteLock or ReadLock#upgradeToWriteLock that have not yet been resolved.
Acquires a read lock.