Skip to content

Commit

Permalink
Update Java基础知识篇.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb authored Aug 1, 2018
1 parent a9b709b commit 061911e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ Java使用自动装箱和拆箱机制,节省了常用数值的内存开销和
(二). 同步阻塞:运行(running)的线程在获取对象的同步锁时,若该同步锁 被别的线程占用,则JVM会把该线程放入锁池(lock pool)中。
(三). 其他阻塞: 运行(running)的线程执行Thread.sleep(long ms)或t.join()方法,或者发出了I/O请求时,JVM会把该线程置为阻塞状态。当sleep()状态超时join()等待线程终止或者超时、或者I/O处理完毕时,线程重新转入可运行(runnable)状态。
5. **死亡(dead)**:线程run()、main()方法执行结束,或者因异常退出了run()方法,则该线程结束生命周期。死亡的线程不可再次复生。

![线程的基本状态](https://user-gold-cdn.xitu.io/2017/12/15/16059cc91ee8efb3?w=876&h=492&f=png&s=-1)

备注:
可以用早起坐地铁来比喻这个过程:
还没起床:sleeping
Expand Down

0 comments on commit 061911e

Please sign in to comment.