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