Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.4
-
None
Description
In order to support non-blocking use cases and be more in-line with Java's Semaphore class, TimedSemaphore should support a tryAcquire() method:
public boolean tryAcquire();
The method checks whether another permit can be acquired. If so, it acquires the permit and returns true. Otherwise, it returns false without blocking the calling thread.