04 2022 档案
摘要:public class CounterUnsafe { volatile int i = 0; private static Unsafe unsafe = null; //i字段的偏移量 private static long valueOffset; static { //unsafe = U
阅读全文
摘要:import java.util.List;import java.util.concurrent.LinkedBlockingQueue;import java.util.concurrent.RejectedExecutionHandler;import java.util.concurrent
阅读全文
摘要:/** 线程封闭示例 */public class Demo5 { /** threadLocal变量,每个线程都有一个副本,互不干扰 */ public static ThreadLocal<String> value = new ThreadLocal<>(); /** * threadloca
阅读全文