Ace Java 2025: Rock Your 'Thinking in Java' Challenge!

Question: 1 / 510

What happens if a thread calls acquire() on a Semaphore and no permits are available?

The thread terminates

The Semaphore's count is reset

The thread proceeds without waiting

The thread is blocked until a permit is available

When a thread calls acquire() on a Semaphore and there are no permits available, the thread is blocked until a permit becomes available. This means that the thread will pause and wait until a permit is released by another thread.

Get further explanation with Examzify DeepDiveBeta
Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy