LockSupport

LockSupport并发等待基本模型

好久不见. 提交于 2019-12-23 10:11:15
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> LockSupport并发等待基本模型。写的个测试,具体请看注释。 package test; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.LockSupport; /** * @author Wei.Chou(weichou2010@gmail.com) * @version 1.0, 12/08/2016 */ public class ParkTest { private static volatile boolean resulted; private static volatile boolean completed; private static volatile boolean end0; private static volatile boolean end1; private static final AtomicInteger parkCount = new AtomicInteger(0); private static