mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-09 03:25:20 +00:00
This closes #411
This commit is contained in:
commit
6435e49e6c
@ -18,8 +18,8 @@ package org.apache.activemq.artemis.core.remoting.impl.netty;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@ -71,7 +71,7 @@ public class NettyConnection implements Connection {
|
||||
|
||||
/** if {@link #isWritable(ReadyListener)} returns false, we add a callback
|
||||
* here for when the connection (or Netty Channel) becomes available again. */
|
||||
private final Deque<ReadyListener> readyListeners = new LinkedBlockingDeque<>();
|
||||
private final Deque<ReadyListener> readyListeners = new LinkedList<>();
|
||||
|
||||
// Static --------------------------------------------------------
|
||||
|
||||
@ -102,19 +102,16 @@ public class NettyConnection implements Connection {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isWritable(ReadyListener callback) {
|
||||
synchronized (readyListeners) {
|
||||
public synchronized boolean isWritable(ReadyListener callback) {
|
||||
if (!ready) {
|
||||
readyListeners.push(callback);
|
||||
}
|
||||
|
||||
return ready;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireReady(final boolean ready) {
|
||||
synchronized (readyListeners) {
|
||||
public synchronized void fireReady(final boolean ready) {
|
||||
this.ready = ready;
|
||||
|
||||
if (ready) {
|
||||
@ -133,7 +130,6 @@ public class NettyConnection implements Connection {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceClose() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user