Synchronizer states

Updated at:

State

Short description

Description

WAITING_ON

Waiting for object notification

The thread is waiting to be notified on an object's monitor (lock). This usually happens when the Object.wait() method is called.

WAITING_TO_RE_LOCK

Waiting to reacquire a lock after a wait

The thread is trying to reacquire a lock but must wait. This typically happens when a thread is notified after calling the wait method and needs to regain the lock of a synchronized block.

WAITING_ON_NO_OBJECT_REFERENCE_AVAILABLE

Waiting for object notification in a JIT-compiled method

In the context of Just-In-Time (JIT) compilation, this state occurs when a thread waits to be notified on an object, but no object reference is available.

PARKING

Parked by Unsafe.park()

The thread is waiting because it called the Unsafe.park() method. This is often used to implement advanced synchronization mechanisms, such as the LockSupport class.

WAITING_ON_CLASS_INITIALIZATION

Waiting for a class initialization lock

The thread is waiting for a class to finish its initialization. This usually happens because another thread is executing the class's static initialization block, and other threads must wait for it to complete.

LOCKED

Holding a lock

The thread holds the monitor (lock) for an object. This forces any other threads that try to acquire the same lock to wait.

WAITING_TO_LOCK

Waiting to acquire a lock

The thread is trying to acquire a lock, but has not succeeded, and is now in a waiting state. This can happen when using the synchronized keyword.