标签: java multithreading atomicinteger
我正在使用public static ThreadLocal<AtomicLong> count = new ThreadLocal<>(); 进行初始化 如何为count使用AtomicLong方法?下面抛出一个NPE:
public static ThreadLocal<AtomicLong> count = new ThreadLocal<>();
count
count.get().addAndGet(records.size());