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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 1b761a9b81 No need for volatile here.
1b761a9b81 is described below

commit 1b761a9b8164a76cbcf8afa9ebd763b5f55113d2
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Sep 18 16:13:28 2026 +0100

    No need for volatile here.
    
    Thanks to Fatima Qaisar
---
 java/org/apache/tomcat/websocket/server/WsWriteTimeout.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/websocket/server/WsWriteTimeout.java 
b/java/org/apache/tomcat/websocket/server/WsWriteTimeout.java
index ffb6f9c01c..3f2eadd968 100644
--- a/java/org/apache/tomcat/websocket/server/WsWriteTimeout.java
+++ b/java/org/apache/tomcat/websocket/server/WsWriteTimeout.java
@@ -40,12 +40,12 @@ public class WsWriteTimeout implements BackgroundProcess {
     private final ReentrantLock backgroundProcessLock = new ReentrantLock();
     private int count = 0;
 
-    private volatile int backgroundProcessCount = 0;
+    private int backgroundProcessCount = 0;
     private volatile int processPeriod = 1;
 
     @Override
     public void backgroundProcess() {
-        // This method gets called once a second.
+        // This method gets called once a second. Always by the 
WsBackgroundThread instance so no concurrency concerns.
         backgroundProcessCount++;
 
         if (backgroundProcessCount >= processPeriod) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to