billbarker    2004/12/10 20:00:35

  Modified:    jk/java/org/apache/jk/common HandlerRequest.java
  Log:
  Syncronize access to the Request registration count.
  
  There are reports on the user list that this isn't close enough to atomic, 
and doesn't happen often enough to worry about the overhead of syncronized.
  
  Revision  Changes    Path
  1.40      +8 -1      
jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java
  
  Index: HandlerRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- HandlerRequest.java       17 Sep 2004 04:50:47 -0000      1.39
  +++ HandlerRequest.java       11 Dec 2004 04:00:35 -0000      1.40
  @@ -189,6 +189,11 @@
        */
       public static final int HOSTBUFFER = 10;
   
  +    /**
  +     * Thread lock.
  +     */
  +    private static Object lock = new Object();
  +
       HandlerDispatch dispatch;
       String ajpidDir="conf";
       
  @@ -451,7 +456,9 @@
               req.setResponse(res);
               ep.setRequest( req );
               if( registerRequests ) {
  -                ep.getSource().registerRequest(req, ep, count++);
  +                synchronized(lock) {
  +                    ep.getSource().registerRequest(req, ep, count++);
  +                }
               }
           }
           return req;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to