Author: markt
Date: Tue Sep 15 08:02:56 2015
New Revision: 1703115

URL: http://svn.apache.org/r1703115
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=58378
Clarify comment on thread-safety.
Ensure the latest pathInfo value is visible to the main test thread.

Modified:
    
tomcat/tc8.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: 
tomcat/tc8.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1703115&r1=1703114&r2=1703115&view=diff
==============================================================================
--- 
tomcat/tc8.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ 
tomcat/tc8.0.x/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
Tue Sep 15 08:02:56 2015
@@ -255,7 +255,7 @@ public class TestCoyoteAdapter extends T
 
         private static final long serialVersionUID = 1L;
 
-        private String pathInfo = null;
+        private volatile String pathInfo = null;
 
         public String getPathInfo() {
             return pathInfo;
@@ -265,7 +265,8 @@ public class TestCoyoteAdapter extends T
         protected void doGet(HttpServletRequest req, HttpServletResponse resp)
                 throws ServletException, IOException {
 
-            // Not thread safe
+            // Not thread safe. Concurrent requests to this servlet will
+            // over-write all the results but the last processed.
             pathInfo = req.getPathInfo();
         }
     }



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

Reply via email to