Examples of notifyAll()


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

         // This is because the counter is decremented and then compared 'less than or equal to' with the
         // max. If this test ever fails below this point, please review that this is still the case.
         executor.submitLimited(nonblockingTask);

         // let them all go.
         synchronized(latch) { latch.set(true);  latch.notifyAll(); }
        
         final int totalCountingExecs = numThreads + 1 + (maxQueued - 1) + 1;

         // wait until they all execute
         assertTrue(TestUtils.poll(baseTimeoutMillis, execCount, new TestUtils.Condition<AtomicLong>() {
View Full Code Here

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

         Thread.sleep(10);
         assertEquals(0,numRejected.intValue());
      }
      finally
      {
         synchronized(latch) { latch.set(true); latch.notifyAll(); }
      }
   }
  

   @Test
View Full Code Here

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

         // now if I add one more I should see exactly one discard.
         executor.submitLimited(nonblockingTask);

         // let them all go.
         synchronized(latch) { latch.set(true); latch.notifyAll(); }
        
         // The additional one added causes one not to count since it's rejected.
         final int totalCountingExecs = numThreads + 1 + (maxQueued - 1) + 1;
        
         // wait until they all execute
View Full Code Here

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

            @Override public boolean conditionMet(DefaultDempsyExecutor executor) { return executor.getNumberPending() == 0; }
         }));
      }
      finally
      {
         synchronized(latch) { latch.set(true); latch.notifyAll(); }
      }
   }
}
View Full Code Here

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

      @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())
View Full Code Here

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

   
   
    // 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

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

            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

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

      @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())
View Full Code Here

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

        group1.addGroupMessageListener(new GroupMessageListener() {
            public void messageDelivered(Member sender, String replyId,
                    Object message) {
                synchronized (called) {
                    called.set(true);
                    called.notifyAll();
                }
            }
        });
        group1.start();
        Group group2 = new Group(connection2, "group2");
View Full Code Here

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

                        e.printStackTrace();
                    }
                }else {
                    synchronized (finished) {
                        finished.set(true);
                        finished.notifyAll();
                    }
                }
            }
        });
        group2.start();
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.