Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicBoolean.notifyAll()


    assertEquals(maxThreads, pool.getPoolSize());

    // Now interrupt the running Executor
    synchronized (lock) {
      lock.set(false);
      lock.notifyAll();
    }

    // Executor increments counter again on way out so.... test that happened.
    while (counter.get() < (maxThreads * 2) && tries < maxTries) {
      System.out.println("Waiting for all event handlers to finish...");
View Full Code Here


        new TestEventHandler(EventType.M_SERVER_SHUTDOWN, lock, counter));
    }
    // Now interrupt the running Executor
    synchronized (lock) {
      lock.set(false);
      lock.notifyAll();
    }

    // Make sure threads are still around even after their timetolive expires.
    Thread.sleep(executor.keepAliveTimeInMillis * 2);
    assertEquals(maxThreads, pool.getPoolSize());
View Full Code Here

              
               public void onException(JMSException e)
               {
                   synchronized(lock) {
                       lock.set(true);
                       lock.notifyAll();
                  }
               }          
           });  

           out.println("kill -STOP " + pid);          
View Full Code Here

   
   
    // Now interrupt the running Executor
    synchronized (lock) {
      lock.set(false);
      lock.notifyAll();
    }

    // Executor increments counter again on way out so.... test that happened.
    while (counter.get() < (maxThreads * 2) && tries < maxTries) {
      System.out.println("Waiting for all event handlers to finish...");
View Full Code Here

            lock, counter));
    }
    // Now interrupt the running Executor
    synchronized (lock) {
      lock.set(false);
      lock.notifyAll();
    }

    // Make sure threads are still around even after their timetolive expires.
    Thread.sleep(ExecutorService.Executor.keepAliveTimeInMillis * 2);
    assertEquals(maxThreads, pool.getPoolSize());
View Full Code Here

      @Override
      public void processResult(int code, String arg1, Object arg2) {
        rc.set(code);
        synchronized (waiter) {
          waiter.set(true);
          waiter.notifyAll();
        }
      }}, null);
    synchronized (waiter) {
      while (!waiter.get())
        waiter.wait();
View Full Code Here

            new Thread() {
              @Override
              public void run() {
                synchronized (waiting) {
                  if (waiting.get()) {
                    waiting.notifyAll();
                  } else {
                    waiting.set(true);
                  }
                  try {
                    waiting.wait();
View Full Code Here

            }.start();
          }
          @Override
          public void cancel() {
            synchronized (waiting) {
              waiting.notifyAll();
            }
          }
        };
      }
    }));
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.