[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/bisocket ...

Ron Sigal ron_sigal at yahoo.com
Sat Jun 2 01:38:44 EDT 2007


  User: rsigal  
  Date: 07/06/02 01:38:44

  Modified:    src/main/org/jboss/remoting/transport/bisocket  Tag:
                        remoting_2_x BisocketClientInvoker.java
  Log:
  JBREM-748:   Put creation of new static Timer in synchronized block.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +33 -24    JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BisocketClientInvoker.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/bisocket/BisocketClientInvoker.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -b -r1.1.2.17 -r1.1.2.18
  --- BisocketClientInvoker.java	2 Jun 2007 05:35:13 -0000	1.1.2.17
  +++ BisocketClientInvoker.java	2 Jun 2007 05:38:44 -0000	1.1.2.18
  @@ -73,6 +73,7 @@
      private static Map listenerIdToCallbackClientInvokerMap = Collections.synchronizedMap(new HashMap());
      private static Map listenerIdToSocketsMap = new HashMap();
      private static Timer timer;
  +   private static Object timerLock;
   
      protected String listenerId;
   
  @@ -221,6 +222,9 @@
               controlOutputStream = controlSocket.getOutputStream();
               log.debug("got control socket: " + controlSocket);
               pingTimerTask = new PingTimerTask(this);
  +
  +            synchronized (timerLock)
  +            {
               if (timer == null)
               {
                  timer = new Timer(true);
  @@ -238,6 +242,7 @@
            }
         }
      }
  +   }
   
      public int getMaxRetries()
      {
  @@ -413,6 +418,9 @@
            pingTimerTask.cancel();
   
         pingTimerTask = new PingTimerTask(this);
  +
  +      synchronized (timerLock)
  +      {
         if (timer == null)
         {
            timer = new Timer(true);
  @@ -428,6 +436,7 @@
            timer.schedule(pingTimerTask, pingFrequency, pingFrequency);
         }
      }
  +   }
   
   
      InvokerLocator getSecondaryLocator() throws Throwable
  
  
  



More information about the jboss-cvs-commits mailing list