摘要: join示例分析 阅读全文
posted @ 2018-11-06 17:13 cxyxq 阅读(270) 评论(0) 推荐(1) 编辑
摘要: yield示例分析 public class TestYield { private static final Object lock = new Object(); public static void main(String[] args) { YieldThread t1 = new YieldThread(); YieldThread ... 阅读全文
posted @ 2018-11-06 17:11 cxyxq 阅读(267) 评论(0) 推荐(0) 编辑
摘要: sleep让"当前线程"由“运行状态”进入到“休眠(阻塞)状态”,sleep结束,线程重新被唤醒时,它会由“阻塞状态”变成“就绪状态”,从而等待cpu的调度执行。 示例分析: 阅读全文
posted @ 2018-11-06 17:07 cxyxq 阅读(232) 评论(0) 推荐(0) 编辑
摘要: wait方法使"当前线程"进入阻塞(等待)状态. 示例分析: 阅读全文
posted @ 2018-11-06 17:03 cxyxq 阅读(434) 评论(0) 推荐(0) 编辑