mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@597582 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ba8b248788
commit
fd2c95e9bc
|
@ -104,6 +104,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
|||
private Map<String, Object> socketOptions;
|
||||
private Boolean keepAlive;
|
||||
private Boolean tcpNoDelay;
|
||||
private Thread runnerThread;
|
||||
|
||||
/**
|
||||
* Connect to a remote Node - e.g. a Broker
|
||||
|
@ -165,6 +166,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
|||
*/
|
||||
public void run() {
|
||||
LOG.trace("TCP consumer thread starting");
|
||||
this.runnerThread=Thread.currentThread();
|
||||
try {
|
||||
while (!isStopped()) {
|
||||
doRun();
|
||||
|
@ -436,7 +438,7 @@ public class TcpTransport extends TransportThreadSupport implements Transport, S
|
|||
public void stop() throws Exception {
|
||||
super.stop();
|
||||
CountDownLatch countDownLatch = stoppedLatch.get();
|
||||
if (countDownLatch != null) {
|
||||
if (countDownLatch != null && Thread.currentThread() != this.runnerThread) {
|
||||
countDownLatch.await();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue