Java thread state transition, WAITING to BLOCKED, or RUNNABLE?

前端 未结 3 904
醉梦人生
醉梦人生 2021-01-30 01:43

There seems to be a discrepancy between SO consensus and nearly every Java thread state diagram on the Internet; specifically, regarding thread state transition from

3条回答
  •  甜味超标
    2021-01-30 02:10

    A thread is in WAITING state goes in BLOCK state,until it acquires monitor by notify and become RUNNABLE.

    Same applies for TIMEDWAITING,it goes in BLOCK state,if monitor is hold by some other thread,even though specified time has passed.(your diagram need to be corrected)

提交回复
热议问题