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 <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]