Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Semaphore.release()


         }
         JGroupsThread jgThread = new JGroupsThread(drm, jgKeys, remote.getName(), semaphore);
         jgThread.start();
        
         // Launch the threads
         semaphore.release(count + 1);
        
         boolean reacquired = false;
         try
         {
            // Give the threads 5 secs to acquire the semaphore
View Full Code Here


   public void testSingleChannel() throws Exception
   {     
      Semaphore s = new Semaphore(1);
      FlushTestReceiver receivers[] = new FlushTestReceiver[]{new FlushTestReceiver("c1", s, false)};
      receivers[0].start();
      s.release(1);

      //Make sure everyone is in sync
      blockUntilViewsReceived(receivers, 60000);

      // Sleep to ensure the threads get all the semaphore tickets
View Full Code Here

            // Release one ticket at a time to allow the thread to start working                          
            channel.start();                     
            if (!useTransfer)
            {
               semaphore.release(1);
            }
            sleepThread(2000);
         }

        
View Full Code Here

            {
               FlushTestReceiver app = (FlushTestReceiver) iter.next();
               app.clear();
              
            }           
            semaphore.release(count);
         }

         // Sleep to ensure the threads get all the semaphore tickets
         sleepThread(1000);
View Full Code Here

               }
            }

            // Release one ticket at a time to allow the thread to start working                          
            channels[i].start();
            semaphore.release(1);
            sleepRandom(1500);
         }

         // Make sure everyone is in sync
         if(isMuxChannelUsed())
View Full Code Here

            blockUntilViewsReceived(channels, 60000);
         }

         sleepThread(2000);
         //Unleash hell !
         semaphore.release(count);

         // Sleep to ensure the threads get all the semaphore tickets
         sleepThread(2000);

         //Reacquire the semaphore tickets; when we have them all
View Full Code Here

         }
         JGroupsThread jgThread = new JGroupsThread(drm, jgKeys, remote.getName(), semaphore);
         jgThread.start();
        
         // Launch the threads
         semaphore.release(count + 1);
        
         boolean reacquired = false;
         try
         {
            // Give the threads 5 secs to acquire the semaphore
View Full Code Here

        
         // Make sure everyone is in sync
         TestingUtil.blockUntilViewsReceived(caches, 60000);
        
         // Release the semaphore to allow the threads to start work
         semaphore.release(count);
        
         // Sleep to ensure the threads get all the semaphore tickets
         TestingUtil.sleepThread(1000);
        
         // Reacquire the semaphore tickets; when we have them all
View Full Code Here

                  stressors[i].startPuts();
               }
//            }
           
            // Release the semaphore to allow the threads to start work
            semaphore.release(count);
           
            // Sleep to ensure the threads get all the semaphore tickets
            // and to ensure puts are actively in progress
            TestingUtil.sleepThread(300);
           
View Full Code Here

        
         // Make sure everyone is in sync
         TestingUtil.blockUntilViewsReceived(caches, 60000);
        
         // Release the semaphore to allow the threads to start work
         semaphore.release(count);
        
         // Sleep to ensure the threads get all the semaphore tickets
          TestingUtil.sleepThread((long)1000);

          // Reacquire the semaphore tickets; when we have them all
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.