多线程生命周期状态
2019-10-21 11:22:21 17 举报
JAVA多线程的生命周期状态
作者其他创作
大纲/内容
BLOCKED
Object.wait()Object.join()LockSupport.park()
获取monitor锁
READY
RUNNABLE
NEW
Thread.start()
WAITING
Object.notify()Object.notifyAll()LockSupport.unpark(Thread)
Thread.sleep(long)Object.wait(long)Object.join(long)LockSupport.parkNanos(long)LockSupport.parkUntil(long)
系统调度
线程大概分为六种状态: NEW RUNNABLE BLOCKED WAITING TIMED_WAITING TERMINATED
等等进入Synchronized方法/Synchronized块
RUNNING
TIMED_WAITING
TERMINATED
0 条评论
下一页