tryAcquire abstract method
Tries to acquire the lock and returns true if the lock was acquired
before the timeout expires, otherwise the acquisition attempt is
canceled and false is returned.
Parameters:
timeout: The period of time during which an attempt to acquire thelockwill be performed.
Implementation
@useResult
Future<bool> tryAcquire(Duration timeout);