From: fhanik Date: Tue, 26 Feb 2008 18:10:12 +0000 (+0000) Subject: no need to sync, the javadoc says it's thread safe X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=feeaad425287e5a3b6b68a1175499482e56ed208;p=tomcat7.0 no need to sync, the javadoc says it's thread safe git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@631315 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java index 8cb0dbee9..54e482c3e 100644 --- a/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java +++ b/java/org/apache/catalina/tribes/transport/nio/NioReplicationTask.java @@ -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 ) {