摘要:
public class Test { private static final Object obj = new Object(); public static void main(String[] args) { new Thread( ()-> { synchronized (obj){ // 尝试获取锁 ... 阅读全文
摘要:
class MyThread5 implements Runnable{ private int flag = 10; @Override public void run() { while (flag > 0){ test(); } } public synchronized void t... 阅读全文