Author: markt
Date: Wed Jun 1 21:55:59 2016
New Revision: 1746504
URL: http://svn.apache.org/viewvc?rev=1746504&view=rev
Log:
Remove unnecessary sync block.
SocketProcessor.run() will acquire a lock on the SocketWrapper and there is
nothing that happens before that point that requires a lock to be held on the
SocketWrapper. Therefore this lock can be removed.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1746504&r1=1746503&r2=1746504&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jun 1
21:55:59 2016
@@ -827,22 +827,17 @@ public class AprEndpoint extends Abstrac
if (socketWrapper == null) {
return false;
}
- // Synchronisation is required here as this code may be called as a
- // result of calling AsyncContext.dispatch() from a non-container
- // thread
- synchronized (socketWrapper) {
- SocketProcessor sc = processorCache.pop();
- if (sc == null) {
- sc = new SocketProcessor(socketWrapper, event);
- } else {
- sc.reset(socketWrapper, event);
- }
- Executor executor = getExecutor();
- if (dispatch && executor != null) {
- executor.execute(sc);
- } else {
- sc.run();
- }
+ SocketProcessor sc = processorCache.pop();
+ if (sc == null) {
+ sc = new SocketProcessor(socketWrapper, event);
+ } else {
+ sc.reset(socketWrapper, event);
+ }
+ Executor executor = getExecutor();
+ if (dispatch && executor != null) {
+ executor.execute(sc);
+ } else {
+ sc.run();
}
} catch (RejectedExecutionException ree) {
log.warn(sm.getString("endpoint.executor.fail", socketWrapper) ,
ree);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]