2023年5月22日

java实现简单自旋锁

摘要: 1 //自定义的自旋锁 2 public class SpinLockDemo { 3 public static void main(String[] args) { 4 5 } 6 7 8 AtomicReference reference = new AtomicReference<Threa 阅读全文

posted @ 2023-05-22 10:54 你就学个JVAV? 阅读(132) 评论(0) 推荐(0)

根据时间戳生成有序id (菜鸟版)

摘要: 代码 @Slf4j public class NumUtil { private static long tmpID = 0; private static final long LOCK_TIME = 1; private static final long INCREASE_STEP = 1; 阅读全文

posted @ 2023-05-22 09:34 你就学个JVAV? 阅读(157) 评论(0) 推荐(0)

导航