You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/06/04 13:37:30 UTC

[tomcat] 02/03: Use NONE instead of 0.

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

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

commit 3428c426c37c907258b4217127409170f9ecca14
Author: remm <re...@apache.org>
AuthorDate: Tue Jun 4 10:58:24 2019 +0200

    Use NONE instead of 0.
---
 java/org/apache/coyote/http2/WindowAllocationManager.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/WindowAllocationManager.java b/java/org/apache/coyote/http2/WindowAllocationManager.java
index 7626bf3..56acab9 100644
--- a/java/org/apache/coyote/http2/WindowAllocationManager.java
+++ b/java/org/apache/coyote/http2/WindowAllocationManager.java
@@ -121,7 +121,7 @@ class WindowAllocationManager {
 
     private void waitFor(int waitTarget, long timeout) throws InterruptedException {
         synchronized (stream) {
-            if (waitingFor != 0) {
+            if (waitingFor != NONE) {
                 throw new IllegalStateException(sm.getString("windowAllocationManager.waitFor.ise",
                         stream.getConnectionId(), stream.getIdentifier()));
             }
@@ -134,14 +134,14 @@ class WindowAllocationManager {
                 stream.wait(timeout);
             }
 
-            waitingFor = 0;
+            waitingFor = NONE;
         }
     }
 
 
     private void waitForNonBlocking(int waitTarget) {
         synchronized (stream) {
-            if (waitingFor == 0) {
+            if (waitingFor == NONE) {
                 waitingFor = waitTarget;
             } else if (waitingFor == waitTarget) {
                 // NO-OP
@@ -162,7 +162,7 @@ class WindowAllocationManager {
         }
 
         synchronized (stream) {
-            if ((notifyTarget & waitingFor) > 0) {
+            if ((notifyTarget & waitingFor) > NONE) {
                 if (stream.getCoyoteResponse().getWriteListener() == null) {
                     // Blocking, so use notify to release StreamOutputBuffer
                     if (log.isDebugEnabled()) {
@@ -171,7 +171,7 @@ class WindowAllocationManager {
                     }
                     stream.notify();
                 } else {
-                    waitingFor = 0;
+                    waitingFor = NONE;
                     // Non-blocking so dispatch
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("windowAllocationManager.dispatched",


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