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() { store.checkMemory(new Runnable() {
@Override @Override
public void run() { public void run() {
if (receiver.getRemoteCredit() < threshold) { synchronized (connection.getLock()) {
receiver.flow(credits); if (receiver.getRemoteCredit() < threshold) {
connection.flush(); receiver.flow(credits);
connection.flush();
}
} }
} }
}); });