Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted.
Acquires a permit, if one is available and returns immediately, reducing the number of available permits by one.
If no permit is available then the current thread becomes disabled for thread scheduling purposes and lies dormant until one of two things happens:
release method for this
semaphore and the current thread is next to be assigned a permit; or
If the current thread:
InterruptedException is thrown and the current thread's
interrupted status is cleared.
InterruptedException | if the current thread is interrupted |
Diagram: Phaser, Semaphore