摘要:
1:方法介绍 suspend():暂停任务 resume():恢复任务 stop():停止任务 不推荐在使用这三个方法已suspend方法为例,在调用后,线程不会释放已经占有的资源比如锁,而是带着资源进入睡眠状态,十分容易引发死锁。同样stop方法在终结一个线程时,不能保证线程资源的正常释放,通常灭 阅读全文
摘要:
1:Thread.init()方法学习 /** * Initializes a Thread. * * @param g the Thread group * @param target the object whose run() method gets called * @param name 阅读全文
摘要:
1:状态分类 2:状态分析 NEW A thread that has not yet started is in this state. 一个被创建的线程,但是还没有调用start方法 RUNNABLE A thread executing in the Java virtual machine 阅读全文