Author: markt
Date: Fri Feb 27 15:01:15 2015
New Revision: 1662705
URL: http://svn.apache.org/r1662705
Log:
Sync no longer necessary without current read/writes (I think)
With the sync there is a deadlock so it has to go.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1662705&r1=1662704&r2=1662705&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Fri Feb 27
15:01:15 2015
@@ -743,7 +743,7 @@ public class Nio2Endpoint extends Abstra
private final CompletionHandler<Integer, ByteBuffer>
writeCompletionHandler;
private final CompletionHandler<Long, ByteBuffer[]>
gatheringWriteCompletionHandler;
- private final Semaphore writePending = new Semaphore(1); // Guarded by
writeCompletionHandler
+ private final Semaphore writePending = new Semaphore(1);
private boolean writeInterest = false; // Guarded by
writeCompletionHandler
private boolean writeNotify = false;
@@ -1192,12 +1192,10 @@ public class Nio2Endpoint extends Abstra
// Before doing a blocking flush, make sure that any pending non
// blocking write has completed.
try {
- synchronized(writeCompletionHandler) {
- if (writePending.tryAcquire(getNio2WriteTimeout(),
TimeUnit.MILLISECONDS)) {
- writePending.release();
- } else {
- throw new SocketTimeoutException();
- }
+ if (writePending.tryAcquire(getNio2WriteTimeout(),
TimeUnit.MILLISECONDS)) {
+ writePending.release();
+ } else {
+ throw new SocketTimeoutException();
}
} catch (InterruptedException e) {
// Ignore
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]