acquireWrite method

Future acquireWrite()

Acquire a write lock

Returns a future that will be completed when the lock has been acquired.

A write lock can only be acquired when there are no other locks (neither read locks nor write locks) on the mutex.

Consider using the convenience method protectWrite, otherwise the caller is responsible for making sure the lock is released after it is no longer needed. Failure to release the lock means no other code can acquire the lock (neither a read lock or a write lock).

Implementation

Future acquireWrite() => _acquire(isRead: false);