Examples of PhaserRegModeImpl


Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

         * 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

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

            scopeBelongsTo.add(this);
        }
       
        Iterator<PhaserRegModeImpl> it = phasers.iterator();
        while (it.hasNext()) {
            PhaserRegModeImpl phImpl = it.next();
            // Wait modes are the only ones that dont need to signal
            if (phImpl.getMode()!=phaserMode.WAIT) {
                phImpl.getPhaser().registerSignaler(this);
            }
            // Signal modes are the only ones that dont need to wait
            if (phImpl.getMode() != phaserMode.SIG) {
                phImpl.getPhaser().registerWaiter(this);
            }
        }
    }
View Full Code Here

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

    // TODO: When error checking is done, make this throw errors
    public void checkPhaserUse(LinkedList checkPhasers) {
        // Makes sure a task's modes are subsets of the phasers
        Iterator<PhaserRegModeImpl> it = (Iterator<PhaserRegModeImpl>)checkPhasers.iterator();
        while (it.hasNext()) {
            PhaserRegModeImpl phaserArg = it.next();
            if (!checkPhaserModeSubset(phaserArg.getPhaser().getMode(), phaserArg.getMode())) {
                // Throw error for a task's mode being outside the heirarchy of phaser's mode
            }
        }
       
        // Makes sure a task's modes are subsets of phasers the parent is in
        it = (Iterator<PhaserRegModeImpl>)checkPhasers.iterator();
        while (it.hasNext()) {
            PhaserRegModeImpl phaserArg = it.next();
            Iterator<PhaserRegModeImpl> parentit = (Iterator<PhaserRegModeImpl>)phasers.iterator();
            while (parentit.hasNext()) {
                PhaserRegModeImpl parentPhaserArg = parentit.next();
                if (parentPhaserArg.getPhaser()==phaserArg.getPhaser()) {
                    if (!checkPhaserModeSubset(parentPhaserArg.getMode(),phaserArg.getMode())) {
                        // Throw error for a task's mode being outside the heirarchy of a parent's phaser mode
                    }
                }
            }
        }
View Full Code Here

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

   
    // Non-blocking signal to all phasers
    public void doSignal() {
        Iterator<PhaserRegModeImpl> iterator = phasers.iterator();
        while (iterator.hasNext()) {
           PhaserRegModeImpl phArgs = iterator.next();
           // Wait modes are the only ones that dont need to signal
           if (phArgs.getMode()!=phaserMode.WAIT)
               phArgs.getPhaser().phSignal(this);
        }
    }
View Full Code Here

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

        //First signal all phasers
        doSignal();
        //Next wait on all phasers
        Iterator<PhaserRegModeImpl> iterator = phasers.iterator();
        while (iterator.hasNext()) {
           PhaserRegModeImpl phArgs = iterator.next();
           // Sig modes are the only ones that dont need to wait
           if (phArgs.getMode()!=phaserMode.SIG)
               phArgs.getPhaser().phWait(this);
        }
    }
View Full Code Here

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

        LinkedList<phaser> singlePhasers = new LinkedList<phaser>();
       
        //First signal all phasers
        Iterator<PhaserRegModeImpl> iterator = phasers.iterator();
        while (iterator.hasNext()) {
           PhaserRegModeImpl phArgs = iterator.next();
           // If it is a single mode, do signalSingle
           if (phArgs.getMode()==phaserMode.SIG_WAIT_SINGLE) {
               if (phArgs.getPhaser().phSignalSingle(this)) {
                   isFirstSingle++;
                   singlePhasers.add(phArgs.getPhaser());
              }
               continue;
           }
          
           // Wait modes are the only ones that dont need to signal
           if (phArgs.getMode()!=phaserMode.WAIT)
               phArgs.getPhaser().phSignal(this);
        }
       
        if (isFirstSingle>0) {
            Iterator<phaser> it = singlePhasers.iterator();
            while (it.hasNext()) {
View Full Code Here

Examples of hj.runtime.wsh.phaser.PhaserRegModeImpl

    }
   
    public void doNext2() {
        Iterator<PhaserRegModeImpl> iterator = phasers.iterator();
        while (iterator.hasNext()) {
           PhaserRegModeImpl phArgs = iterator.next();
           if (phArgs.getMode()==phaserMode.SIG_WAIT_SINGLE) {
               phArgs.getPhaser().phWaitSingle(this);
           } else if (phArgs.getMode()!=phaserMode.SIG) {
               phArgs.getPhaser().phWait(this);
           }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.