This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 81208e5ca0 Refactor to use a common lock for filters
81208e5ca0 is described below

commit 81208e5ca044141df4409c410030e45f18966ae4
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Aug 10 14:25:58 2023 +0100

    Refactor to use a common lock for filters
---
 java/org/apache/catalina/core/StandardContext.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 58b97c6d8f..3b7616050b 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -357,7 +357,7 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
     /**
      * The set of filter configurations (and associated filter instances) we 
have initialized, keyed by filter name.
      */
-    private Map<String,ApplicationFilterConfig> filterConfigs = new 
HashMap<>();
+    private Map<String,ApplicationFilterConfig> filterConfigs = new 
HashMap<>(); // Guarded by filterDefs
 
 
     /**
@@ -4269,7 +4269,7 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
         }
         // Instantiate and record a FilterConfig for each defined filter
         boolean ok = true;
-        synchronized (filterConfigs) {
+        synchronized (filterDefs) {
             filterConfigs.clear();
             for (Entry<String,FilterDef> entry : filterDefs.entrySet()) {
                 String name = entry.getKey();
@@ -4304,7 +4304,7 @@ public class StandardContext extends ContainerBase 
implements Context, Notificat
         }
 
         // Release all Filter and FilterConfig instances
-        synchronized (filterConfigs) {
+        synchronized (filterDefs) {
             for (Entry<String,ApplicationFilterConfig> entry : 
filterConfigs.entrySet()) {
                 if (getLogger().isDebugEnabled()) {
                     getLogger().debug(" Stopping filter '" + entry.getKey() + 
"'");


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

Reply via email to