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