This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 22f43571ce No need for volatile here.
22f43571ce is described below
commit 22f43571ce22311acddb43ea32bb754e94f0e21e
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 15d9949e1e..e1f80b845b 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]