Course contentsShow
← Java
Lesson 2585 of 2,87048. Concurrency FundamentalsFree lesson

WAITING State: Indefinite Wait

Understanding WAITING state caused by Object.wait(), Thread.join(), or LockSupport.park() without timeout.

WAITING State: Indefinite Wait

What you'll learn: How threads enter the WAITING state when they need to wait indefinitely for another thread's action.


When a thread is in the WAITING state, it has voluntarily paused its execution and is waiting for another thread to perform a specific action—with no time limit. Unlike BLOCKED (where a thread waits for a lock), WAITING means the thread has explicitly called a method that puts it to sleep until awakened by another thread.

How Threads Enter WAITING

Three primary mechanisms cause a thread to enter WAITING:

1. Object.wait() – A thread holding a monitor lock calls wait() on that object, releasing the lock and waiting until another thread calls notify() or notifyAll() on the same object.

2. Thread.join() – When you call join() on another thread, the current thread waits indefinitely until that other thread completes its execution.

3. LockSupport.park() – A low-level parking mechanism that suspends the thread until LockSupport.unpark() is called (typically used by advanced concurrency utilities).

The Key Difference: Indefinite vs Timed

WAITING is indefinite—there's no timeout. The thread will stay parked until explicitly awakened. If you specified a timeout (like wait(1000) or join(500)), the thread would enter TIMED_WAITING instead, which we haven't covered yet.

Think of It This Way

Imagine you're waiting at a bus stop with no schedule. You sit down indefinitely until the bus arrives (another thread signals you). You're not blocked by a locked door—you've chosen to wait for a specific event.

Key Takeaway:
WAITING state occurs when a thread voluntarily pauses indefinitely via Object.wait(), Thread.join(), or LockSupport.park(), and can only resume when another thread explicitly signals or completes.