Package hj.runtime.wsh

Examples of hj.runtime.wsh.Activity


         * The phaser has the parent in it to prevent it from advancing to the next phase
         * before the finish scope hits end scope
         * When the parent hits stopFinish(), the parent will deregister itself so that
         * the phaser can now advance to the next phase
         */
        Activity parent = (Activity) Thread.currentThread();
        scope = parent.getCurrentFinishScope();
        parent.addPhaser(new PhaserRegModeImpl(this,phaserMode.SIG_WAIT));
        scope.addPhaser(this);
        registerSignaler(parent);
        registerWaiter(parent);
    }
View Full Code Here


    //      -Notify all blocked waiters that phase has advanced
    private void advancePhase() {
        try {
            lock.lock();
            for (Map.Entry<Activity, Integer> entry : signalers.entrySet()) {
                Activity signaler = entry.getKey();
                int signalValue = entry.getValue();
                signalers.put(signaler, signalValue-1);
                signalValue--;
                if (signalValue == 0) yetToSignal++;
            }
            for (Map.Entry<Activity, Integer> entry : waiters.entrySet()) {
                Activity waiter = entry.getKey();
                int waitValue = entry.getValue();
                waiters.put(waiter, waitValue+1);
            }
            phaseAdvance.signalAll();
        } finally {
View Full Code Here

TOP

Related Classes of hj.runtime.wsh.Activity

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.