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

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

commit c846f70814a5b0f31d66acfdbff893641b8f9b8a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 15 13:52:42 2021 +0100

    Move debug statement inside sync block
    
    Ensures that the values logged are consistent with the values processed.
---
 java/org/apache/coyote/http2/WindowAllocationManager.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http2/WindowAllocationManager.java 
b/java/org/apache/coyote/http2/WindowAllocationManager.java
index 96016cc..6c824a5 100644
--- a/java/org/apache/coyote/http2/WindowAllocationManager.java
+++ b/java/org/apache/coyote/http2/WindowAllocationManager.java
@@ -172,12 +172,13 @@ class WindowAllocationManager {
 
 
     private void notify(int notifyTarget) {
-        if (log.isDebugEnabled()) {
-            log.debug(sm.getString("windowAllocationManager.notify", 
stream.getConnectionId(),
-                    stream.getIdAsString(), Integer.toString(waitingFor), 
Integer.toString(notifyTarget)));
-        }
 
         synchronized (stream) {
+            if (log.isDebugEnabled()) {
+                log.debug(sm.getString("windowAllocationManager.notify", 
stream.getConnectionId(),
+                        stream.getIdAsString(), Integer.toString(waitingFor), 
Integer.toString(notifyTarget)));
+            }
+
             if ((notifyTarget & waitingFor) > NONE) {
                 // Reset this here so multiple notifies (possible with a
                 // backlog containing multiple streams and small window 
updates)

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

Reply via email to