[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/oneway ...

Ron Sigal ron_sigal at yahoo.com
Tue Nov 6 22:32:51 EST 2007


  User: rsigal  
  Date: 07/11/06 22:32:51

  Modified:    src/tests/org/jboss/test/remoting/oneway  Tag: remoting_2_x
                        OnewayThreadPoolTestCase.java
  Log:
  JBREM-800:  Replace go flag busy wait with synchronized wait.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +32 -8     JBossRemoting/src/tests/org/jboss/test/remoting/oneway/Attic/OnewayThreadPoolTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OnewayThreadPoolTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/oneway/Attic/OnewayThreadPoolTestCase.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -b -r1.1.2.4 -r1.1.2.5
  --- OnewayThreadPoolTestCase.java	3 Nov 2007 03:54:39 -0000	1.1.2.4
  +++ OnewayThreadPoolTestCase.java	7 Nov 2007 03:32:51 -0000	1.1.2.5
  @@ -54,7 +54,7 @@
    * See JBREM-658.
    * 
    * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
  - * @version $Revision: 1.1.2.4 $
  + * @version $Revision: 1.1.2.5 $
    * <p>
    * Copyright Feb 6, 2007
    * </p>
  @@ -67,6 +67,7 @@
      protected static Logger log = Logger.getLogger(OnewayThreadPoolTestCase.class);
      protected static boolean firstTime = true;
      protected static boolean go;
  +   protected static Object lock = new Object();
      protected static int poolCounter;
      
      public void setUp() throws Exception
  @@ -342,7 +343,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         poolCounter++;
         Thread.sleep(10000);
         
  @@ -401,7 +407,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         poolCounter++;
         Thread.sleep(5000);
         
  @@ -616,7 +627,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         poolCounter++;
         Thread.sleep(5000);
         
  @@ -668,7 +684,12 @@
            threads[i].start();
         }
         
  +      synchronized (lock)
  +      {
         go = true;
  +         lock.notifyAll();
  +      }
  +      
         poolCounter++;
         Thread.sleep(10000);
         
  @@ -712,9 +733,12 @@
         {
            try
            {
  +            synchronized (lock)
  +            {
               while (!go)
               {
  -               try {Thread.sleep(1);} catch (InterruptedException e) {}
  +                  try {lock.wait();} catch (InterruptedException e) {}
  +               }
               }
               
               client.invokeOneway(FAST + id, null, clientSide);
  
  
  



More information about the jboss-cvs-commits mailing list