摘要:
package com.chnsys.threaddemo;public class JavaResearch { /** * @param args * 模拟死锁 * */ //等待唤醒机制 /*1:input: flag flag == flase: 设值-->置为true-->notify-->wait flag == true: wait 2:output: flag == true: 输出-->置为false-->notify-->wait ... 阅读全文
摘要:
package com.chnsys.threaddemo;public class JavaResearch { /** * @param args * 模拟死锁 * */ //等待唤醒机制 /*1:input: flag flag == flase: 设值-->置为true-->notify-->wait flag == true: wait 2:output: flag == true: 输出-->置为false-->notify-->wait ... 阅读全文
摘要:
package com.chnsys.threaddemo;public class JavaResearch { /** * @param args * 模拟死锁 */ public static void main(String[] args) { // TODO Auto-generated method stub Ticket t_true = new Ticket(true); Ticket t_false = new Ticket(false); Thread t1 = new Thread... 阅读全文