摘要: package com.kaibing.thread; /** * 线程的通信 * * wati() * notify():随机唤醒一个 * notifyAll():全部唤醒 */ class PrintNum implements Runnable { int num = 1; @Override public void run() { ... 阅读全文
posted @ 2018-06-27 13:09 楷兵 阅读(114) 评论(0) 推荐(0) 编辑
摘要: public class DeadLock { static StringBuffer sb1 = new StringBuffer(); static StringBuffer sb2 = new StringBuffer(); public static void main(String[] args) { new Thread(()->{ ... 阅读全文
posted @ 2018-06-27 12:48 楷兵 阅读(120) 评论(0) 推荐(0) 编辑