Examples of Semaphore


Examples of nexj.core.meta.workflow.Semaphore

               branch = new Branch();
               decision.addBranch(branch);

               assignment.setSemaphore(true);

               Semaphore semaphore = new Semaphore(assignment.getName() + ":Semaphore", assignment);

               semaphore.setActivity(activity);
               activity.addStep(semaphore);

               Block block = new Block();

               block.setActivity(branch);
               branch.addStep(block);
               loadActivity(child, block.getContainedActivity());
               block.setCleanupCode(semaphore.getExitCode());
            }
            else
            {
               throw new MetadataException("err.meta.workflow.invalidQueueElement",
                  new Object[]{sElement, assignment.getName()});
View Full Code Here

Examples of org.clapper.util.misc.Semaphore

        private void doTest()
            throws SemaphoreException
        {
            boolean acquired = false;
            Semaphore semaphore = TestSemaphore.this.semaphore;
            Semaphore parentSem = TestSemaphore.this.parentSem;
            int holdTime = TestSemaphore.this.holdTime;
            int pendTime = TestSemaphore.this.pendTime;

            message ("Acquiring " + semaphore.toString() +
                     ", pendTime = " + pendTime);

            acquired = semaphore.acquire (pendTime);
            if (! acquired)
                message ("*** Failed to acquire semaphore.");

            else
            {
                // Synchronize on something else, to test deadlock.

                synchronized (TestSemaphore.class)
                {
                    message ("Got semaphore " + semaphore + ". Waiting " +
                             holdTime + " milliseconds.");
                }

                try
                {
                    Thread.yield();
                    Thread.sleep (holdTime);
                }

                catch (InterruptedException ex)
                {
                }

                synchronized (TestSemaphore.class)
                {
                    message ("Releasing semaphore " + semaphore + ".");

                }

                semaphore.release();
            }

            message ("Notifying parent.");
            parentSem.release();
            message ("Exiting.");
        }
View Full Code Here

Examples of org.jamesii.core.util.Semaphore

        + processor.getModelName() + ")");

    this.processor = processor;
    // this semaphore can be used by the nextStep method implementation by using
    // the P and V operations of this thread
    pause = new Semaphore(-1);
  }
View Full Code Here

Examples of org.objectweb.perseus.concurrency.lib.Semaphore

  /**
   *
   */
  public AbstractPOManager() {
        semaphore = new Semaphore(false);
  }
View Full Code Here

Examples of org.quartz.impl.jdbcjobstore.Semaphore

        if (js instanceof JobStoreSupport) {
            // Install custom lock handler (Semaphore)
            String lockHandlerClass = cfg.getStringProperty(PROP_JOB_STORE_LOCK_HANDLER_CLASS);
            if (lockHandlerClass != null) {
                try {
                    Semaphore lockHandler = (Semaphore)loadHelper.loadClass(lockHandlerClass).newInstance();

                    tProps = cfg.getPropertyGroup(PROP_JOB_STORE_LOCK_HANDLER_PREFIX, true);

                    // If this lock handler requires the table prefix, add it to its properties.
                    if (lockHandler instanceof TablePrefixAware) {
View Full Code Here

Examples of threads.Semaphore

    }

    static void complicatedThreads() {
        Task task = new Task();
        task.count = 100;
        Semaphore semaphore = new Semaphore();
        Thread generatorThread = new Generator(task, semaphore, "Generator");
        //generatorThread.setPriority(Thread.MAX_PRIORITY);
        Thread integratorThread = new Integrator(task, semaphore, "Integrator");
        //integratorThread.setPriority(Thread.MAX_PRIORITY);
        //System.err.println("" + generatorThread.getPriority() + " " + integratorThread.getPriority());
View Full Code Here

Examples of uk.co.mmscomputing.concurrent.Semaphore

    adfcount   = -1;                         // -1: no limit; 0: don't scan; >0 scan count pages
    state      = SANE_STATE_EXIT;
    showUI     = true;
    showPB     = true;
    pbar       = null;
    blocker    = new Semaphore(1,true);
  }
View Full Code Here

Examples of utils.Semaphore

    color          = DEFAULT_COLOR;
    visible          = true;
    initPosition      = new double[2];
    courseArrow        = new int[6];
    thread          = null;
    commChannelSemaphore  = new Semaphore( 1 );
    guiSemaphore      = new Semaphore( 1 );
    robotStateSemaphore    = new Semaphore( 1 );
    neuralNet        = null;
    disposed        = false;
    stopped          = false;
    paused          = true;
    firstTime        = true;
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.