Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Latch


                        && !readLockMap.hasDependency(changeLog)) {
                    activeWriter = new WriteLockImpl(changeLog);
                    activeWriterThread = Thread.currentThread();
                    return activeWriter;
                } else {
                    signal = new Latch();
                    waitingWriters.add(signal);
                }
            } finally {
                exclusive.release();
            }
View Full Code Here


                if (activeWriter == null
                        || !hasDependency(activeWriter.changes, id)) {
                    readLockMap.addLock(id);
                    return new ReadLockImpl(id);
                } else {
                    signal = new Latch();
                    waitingReaders.add(signal);
                }
            } finally {
                shared.release();
            }
View Full Code Here

                        && !readLockMap.hasDependency(changeLog)) {
                    activeWriter = new WriteLockImpl(changeLog);
                    activeWriterThread = Thread.currentThread();
                    return activeWriter;
                } else {
                    signal = new Latch();
                    waitingWriters.add(signal);
                }
            } finally {
                exclusive.release();
            }
View Full Code Here

* */
public class SyncWorkExecutor implements WorkExecutor {

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideEndLatch();
        executor.execute(work);
        latch.acquire();
    }
View Full Code Here

* */
public class StartWorkExecutor implements WorkExecutor {

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideStartLatch();
        executor.execute(work);
        latch.acquire();
    }
View Full Code Here

    /**
   * @see org.apache.geronimo.network.protocol.ProtocolStack#cloneProtocol()
   */
  public Protocol cloneProtocol() throws CloneNotSupportedException {
    ControlClientProtocolKitchen p = (ControlClientProtocolKitchen) super.cloneProtocol();
    p.sendLatch = new Latch();
    return p;
  }
View Full Code Here

        }
    }

    public void setUp() throws Exception {
        eup = new EchoUpProtocol();
        startLatch = new Latch();
        failed = false;
    }
View Full Code Here

    public void setStoppedRoutingTimeout(long stoppedRoutingTimeout) {
        this.stoppedRoutingTimeout = stoppedRoutingTimeout;
    }

    private Sync createNewRouterLock() {
        Latch lock = new Latch();
        return new TimeoutSync(lock, stoppedRoutingTimeout);
    }
View Full Code Here

    }

    public void setUp() throws Exception {
        Configuration.setConfiguration(new GeronimoLoginConfiguration());

        startLatch = new Latch();
        shutdownLatch = new Latch();
        stopLatch = new Latch();

        super.setUp();

        GBeanMBean gbean;
View Full Code Here

            return null;
        }
    }

    public void setUp() throws Exception {
        startLatch = new Latch();
        shutdownLatch = new Latch();
        stopLatch = new Latch();
        completed = new CountDown(COUNT);
        try {
            properties = new Properties();
            try {
                properties.load(new File(System.getProperty("user.home") + "/login.properties").toURI().toURL().openStream());
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.Latch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.