tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49986] New: Double-check locking. Possible data-race in JspServletWrapper
Date Thu, 23 Sep 2010 13:31:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49986

           Summary: Double-check locking. Possible data-race in
                    JspServletWrapper
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sergeyvorobyev@google.com


r998053
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java

Common anti-pattern: Double checked locking. I don't know is this race
dangerous or no.

Race on private boolean reload

public Servlet getServlet()
        throws ServletException, IOException, FileNotFoundException
    {
        if (reload) {
            synchronized (this) {
                // Synchronizing on jsw enables simultaneous loading
                // of different pages, but not the same page.
                if (reload) {
                    // This is to maintain the original protocol.

..........

                    theServlet = servlet;
                    reload = false;
                }
            }    
        }
        return theServlet;
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message