ARTEMIS-908: Hold connection lock when issuing credits

This commit is contained in:
Ulf Lilleengen 2017-01-03 11:03:38 +01:00 committed by Justin Bertram
parent 4dc9751874
commit f2f3552067
1 changed files with 5 additions and 3 deletions

View File

@ -433,9 +433,11 @@ public class AMQPSessionCallback implements SessionCallback {
store.checkMemory(new Runnable() {
@Override
public void run() {
if (receiver.getRemoteCredit() < threshold) {
receiver.flow(credits);
connection.flush();
synchronized (connection.getLock()) {
if (receiver.getRemoteCredit() < threshold) {
receiver.flow(credits);
connection.flush();
}
}
}
});