摘要:
@SuppressWarnings("restriction") public abstract class AbstractQueuedSynchronizer1 extends AbstractOwnableSynchronizer1 implements java.io.Serializable { private static final long serialVersionUI... 阅读全文
摘要:
@SuppressWarnings("restriction") public class ReentrantReadWriteLock1 implements ReadWriteLock, java.io.Serializable { private static final long serialVersionUID = -6992448646407690164L; priv... 阅读全文
摘要:
public class ReentrantLock1 implements Lock, java.io.Serializable { private static final long serialVersionUID = 7373984872572414699L; //创建一个ReentrantLock1里面有一个sync,里面有一个state和队列。 //多个线程竞... 阅读全文
摘要:
public class CyclicBarrierExample3 { private static CyclicBarrier1 barrier = new CyclicBarrier1(3, new Runnable() { @Override public void run() { System.out.printl... 阅读全文
摘要:
public class CountDownLatchExample1 { public static void main(String[] args) throws Exception { ExecutorService exec = Executors1.newCachedThreadPool(); final CountDownLatch1 coun... 阅读全文
摘要:
public class SemaphoreExample1 { private final static int threadCount = 20; public static void main(String[] args) throws Exception { ExecutorService exec = Executors1.newCachedThrea... 阅读全文