标签:== ring protect div getname override hashmap current cte
public class ReadSku extends Logger{ static class Num implements Runnable{ public int a = 0; @Override public void run() { synchronized (Num.class){ for (int i = 0; i < 10; i++) { System.out.println(Thread.currentThread().getName()+"========"+a++); } } } } protected ReadSku(String name) { super(name); } static Logger logger = Logger.getLogger(ReadSku.class); public static void main(String[] args) throws IOException { // HashMap map = new HashMap<>(); // getprice();//单个遍历表信息 Num num1 = new Num(); Num num2 = new Num(); Num num3 = new Num(); Thread thread1 = new Thread(num1); Thread thread2 = new Thread(num2); Thread thread3 = new Thread(num3); thread1.start(); thread2.start(); // thread3.start(); }
标签:== ring protect div getname override hashmap current cte
原文地址:https://www.cnblogs.com/kuoAT/p/9778176.html