tryAcquire abstract method

  1. @useResult
Future<bool> tryAcquire(
  1. Duration timeout
)

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 the lock will be performed.

Implementation

@useResult
Future<bool> tryAcquire(Duration timeout);