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

Disable ads (and more) with a membership for a one time $4.99 payment

Question: 1 / 515

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.

Next

Report this question