This is an automated email from the ASF dual-hosted git repository. remm 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 00c06bb081 Remove sync 00c06bb081 is described below commit 00c06bb081a273d7ec41d0de926ace94733955ab Author: remm <r...@apache.org> AuthorDate: Thu Jan 18 15:25:38 2024 +0100 Remove sync This is always called after creating a message. This does not appear to be called again so I don't really see the need for timestampSet. If really needed, using an AtomicLong would probably be better (with compareAndSet(0, time)). Found by coverity. --- java/org/apache/catalina/ha/session/SessionMessageImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/java/org/apache/catalina/ha/session/SessionMessageImpl.java b/java/org/apache/catalina/ha/session/SessionMessageImpl.java index 3c2884ae9a..bb54b5d666 100644 --- a/java/org/apache/catalina/ha/session/SessionMessageImpl.java +++ b/java/org/apache/catalina/ha/session/SessionMessageImpl.java @@ -112,14 +112,13 @@ public class SessionMessageImpl extends ClusterMessageBase implements SessionMes /** * set message send time but only the first setting works (one shot) + * @param time the timestamp */ @Override public void setTimestamp(long time) { - synchronized (this) { - if (!timestampSet) { - serializationTimestamp = time; - timestampSet = true; - } + if (!timestampSet) { + serializationTimestamp = time; + timestampSet = true; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org