acquire method

Future acquire()

Acquire a lock

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

Consider using the convenience method protect, 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.

Implementation

Future acquire() => _rwMutex.acquireWrite();