摘要:
//測試lock鎖 public class TestLock { public static void main(String[] args) { TestLock2 testLock2 = new TestLock2(); new Thread(testLock2).start(); new T 阅读全文
摘要:
//死锁:多个线程相互抱着对方需要的资源,然后形成僵局 public class DeadLock { public static void main(String[] args) { Makeup makeup1 = new Makeup(0,"小老虎"); Makeup makeup2 = ne 阅读全文
摘要:
public class UnsafeBuyTicket { public static void main(String[] args) { BuyTicket station = new BuyTicket(); new Thread(station,"苦逼的我").start(); new T 阅读全文
摘要:
public static void main(String[] args) throws InterruptedException { //sleep打印系统时间 while(true){ //打印当前时间 Date date = new Date(System.currentTimeMillis 阅读全文