marcsaeg 01/04/27 13:51:48
Modified: src/share/org/apache/jasper/servlet Tag: tomcat_32
JspServlet.java
Log:
The last commit accidentally remove a previous thread synchronization fix.
The creation of the compiler in doLoadJSP() must be synchronized.
Revision Changes Path
No revision
No revision
1.3.2.7 +9 -2
jakarta-tomcat/src/share/org/apache/jasper/servlet/JspServlet.java
Index: JspServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/servlet/JspServlet.java,v
retrieving revision 1.3.2.6
retrieving revision 1.3.2.7
diff -u -r1.3.2.6 -r1.3.2.7
--- JspServlet.java 2001/04/25 23:29:30 1.3.2.6
+++ JspServlet.java 2001/04/27 20:51:47 1.3.2.7
@@ -418,7 +418,7 @@
* Several threads may be handling requests for the same jspUri.
* Only one of them is allowed to create the JspServletWrapper.
*/
- synchronized(this){
+ synchronized(jsps){
wrapper = (JspServletWrapper) jsps.get(jspUri);
if(wrapper == null) {
wrapper = new JspServletWrapper(jspUri, isErrorPage);
@@ -593,7 +593,14 @@
req, res);
boolean outDated = false;
- Compiler compiler = ctxt.createCompiler();
+ synchronized(jsw){
+ /*
+ * Creating a compiler opens the associated .class file (if it exists)
+ * and reads the actual class name. If we allow a compiler to be
+ * created while a compile is going on then bad things can happen.
+ */
+ Compiler compiler = ctxt.createCompiler();
+ }
try {