Skip to content

Commit

Permalink
[Broker] Make Persistent*DispatcherMultipleConsumers.readMoreEntries …
Browse files Browse the repository at this point in the history
…synchronized (apache#10413)
  • Loading branch information
lhotari authored Apr 28, 2021
1 parent 9e8949b commit 55867f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public synchronized void consumerFlow(Consumer consumer, int additionalNumberOfM
readMoreEntries();
}

public void readMoreEntries() {
public synchronized void readMoreEntries() {
// totalAvailablePermits may be updated by other threads
int currentTotalAvailablePermits = totalAvailablePermits;
if (currentTotalAvailablePermits > 0 && isAtleastOneConsumerAvailable()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected void cancelPendingRead() {
}

@Override
public void readMoreEntries() {
public synchronized void readMoreEntries() {
// totalAvailablePermits may be updated by other threads
int currentTotalAvailablePermits = totalAvailablePermits;
if (currentTotalAvailablePermits > 0 && isAtleastOneConsumerAvailable()) {
Expand Down

0 comments on commit 55867f1

Please sign in to comment.