30.Java 多线程锁(synchronized 锁的八种情况、synchronized 锁、公平锁与非公平锁、可重入锁、死锁)
一、synchronized锁的八种情况1、情况一(1)需求一部手机,测试先是AA线程打印短信还是BB线程打印邮件(2)测试Phone资源类packagecom.my.sync;publicclassPhone{publicsynchronizedvoidsendMes(){System.out.println("method1:sendMes");}publicsynchronizedvoids