NOTE

6.40 Thread States

1. Thread state enum. 2. State transitions. 3. References.

JavaCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. Thread State Enum

public enum State {
    // A Thread after new, before start
    NEW,

    // A Thread after start; it may not have obtained the CPU yet
    RUNNABLE,

    // A Thread waiting for a monitor
    BLOCKED,

    // A thread in the waiting state after calling Object.wait(),
    // Thread.join, or LockSupport.park()
    WAITING,

    // A thread after calling Thread.sleep, Object.wait(long),
    // Thread.join(long), LockSupport.parkNanos, or LockSupport.parkUntil
    TIMED_WAITING,

    // A thread that has finished running
    TERMINATED;
}

2. State Transitions

3. References

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub