ARTEMIS-892 - add lock to tick method
https://issues.apache.org/jira/browse/ARTEMIS-892
This commit is contained in:
parent
db6ee74a33
commit
198143edd0
|
@ -91,6 +91,7 @@ public class ProtonHandler extends ProtonInitializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public long tick(boolean firstTick) {
|
public long tick(boolean firstTick) {
|
||||||
|
synchronized (lock) {
|
||||||
if (!firstTick) {
|
if (!firstTick) {
|
||||||
try {
|
try {
|
||||||
if (connection.getLocalState() != EndpointState.CLOSED) {
|
if (connection.getLocalState() != EndpointState.CLOSED) {
|
||||||
|
@ -108,6 +109,7 @@ public class ProtonHandler extends ProtonInitializable {
|
||||||
}
|
}
|
||||||
return transport.tick(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()));
|
return transport.tick(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int capacity() {
|
public int capacity() {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
|
|
Loading…
Reference in New Issue