tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Compiler.java
Date Tue, 06 Aug 2002 23:40:10 GMT
kinman      2002/08/06 16:40:10

  Modified:    jasper2/src/share/org/apache/jasper/compiler Compiler.java
  Log:
  - Serialize javac compilation - some java compiler (e.g. jdk1.4 javac)
    is not thread-safe.
  
  Revision  Changes    Path
  1.25      +9 -4      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
  
  Index: Compiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Compiler.java	5 Aug 2002 23:46:28 -0000	1.24
  +++ Compiler.java	6 Aug 2002 23:40:10 -0000	1.25
  @@ -109,6 +109,9 @@
   
       }
   
  +    // Some javac are not thread safe; use a lock to serialize compilation, 
  +    static Object javacLock = new Object();
  +
   
       // ----------------------------------------------------- Instance Variables
   
  @@ -301,7 +304,9 @@
           javac.setIncludes(ctxt.getJspPath());
   
           try {
  -            javac.execute();
  +            synchronized(javacLock) {
  +                javac.execute();
  +            }
           } catch (BuildException e) {
               //   System.out.println("Javac execption ");
               //   e.printStackTrace(System.out);
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message