no need to sync, the javadoc says it's thread safe
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 26 Feb 2008 18:10:12 +0000 (18:10 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 26 Feb 2008 18:10:12 +0000 (18:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@631315 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java

index 8cb0dbe..54e482c 100644 (file)
@@ -308,12 +308,10 @@ public class NioReplicationTask extends AbstractRxTask {
             int total = 0;
             if (channel instanceof DatagramChannel) {
                 DatagramChannel dchannel = (DatagramChannel)channel;
-                //were using a shared channel, it's not thread safe
-                //TODO check optimization, one channel per thread
-                synchronized (dchannel) {
-                    while ( total < command.length ) {
-                        total += dchannel.send(buf, udpaddr);
-                    }
+                //were using a shared channel, document says its thread safe
+                //TODO check optimization, one channel per thread?
+                while ( total < command.length ) {
+                    total += dchannel.send(buf, udpaddr);
                 }
             } else {
                 while ( total < command.length ) {