You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/04/06 13:39:37 UTC
[tomcat] branch 9.0.x updated: Additional place where sync needs to be replaced with ReentrantLock
This is an automated email from the ASF dual-hosted git repository.
markt 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 90daa3fab5 Additional place where sync needs to be replaced with ReentrantLock
90daa3fab5 is described below
commit 90daa3fab5f325a06a4eb914dfc1920d06562990
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Apr 6 14:39:30 2023 +0100
Additional place where sync needs to be replaced with ReentrantLock
---
java/org/apache/tomcat/util/net/AprEndpoint.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 5a82cfcf42..87d1aa26b0 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -2103,7 +2103,9 @@ public class AprEndpoint extends AbstractEndpoint<Long,Long> implements SNICallB
@Override
public void run() {
- synchronized (socket) {
+ Lock lock = socket.getLock();
+ lock.lock();
+ try {
if (!deferAccept) {
if (setSocketOptions(socket)) {
getPoller().add(socket.getSocket().longValue(),
@@ -2131,6 +2133,8 @@ public class AprEndpoint extends AbstractEndpoint<Long,Long> implements SNICallB
socket = null;
}
}
+ } finally {
+ lock.unlock();
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org