Author: markt
Date: Tue Sep 15 08:04:43 2015
New Revision: 1703116

URL: http://svn.apache.org/r1703116
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/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java

Modified: tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1703116&r1=1703115&r2=1703116&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java Tue 
Sep 15 08:04:43 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