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 09ecb572a6 Simplify. Covered by wider sync.
09ecb572a6 is described below

commit 09ecb572a643e6692b5f13d414ae8a6a04a16192
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 30 15:51:20 2026 +0100

    Simplify. Covered by wider sync.
---
 .../catalina/ha/deploy/FileMessageFactory.java     | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java 
b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
index bed73ed68a..fd57999ec1 100644
--- a/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
+++ b/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
@@ -245,17 +245,15 @@ public class FileMessageFactory {
         lastModified = System.currentTimeMillis();
 
         FileMessage next;
-        synchronized (this) {
-            if (!isWriting) {
-                next = msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 
1));
-                if (next != null) {
-                    isWriting = true;
-                } else {
-                    return false;
-                }
+        if (!isWriting) {
+            next = msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 1));
+            if (next != null) {
+                isWriting = true;
             } else {
                 return false;
             }
+        } else {
+            return false;
         }
 
         while (next != null) {
@@ -267,11 +265,9 @@ public class FileMessageFactory {
                 cleanup();
                 return true;
             }
-            synchronized (this) {
-                next = msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 
1));
-                if (next == null) {
-                    isWriting = false;
-                }
+            next = msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 1));
+            if (next == null) {
+                isWriting = false;
             }
         }
 


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

Reply via email to