Skip to content

Commit

Permalink
removed synchronization block:
Browse files Browse the repository at this point in the history
- AbstractFateStore still had a synchronization block for accessing `deferred` which was changed to a synchronized map in this PR; removed since there shouldn't be any more sync blocks in this class.
  • Loading branch information
kevinrr888 committed Aug 21, 2024
1 parent 55f02d1 commit 3557252
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,10 @@ public void runnable(AtomicBoolean keepWaiting, Consumer<FateId> idConsumer) {
if (seen.get() == 0) {
if (beforeCount == unreservedRunnableCount.getCount()) {
long waitTime = 5000;
synchronized (AbstractFateStore.this) {
if (!deferred.isEmpty()) {
waitTime = deferred.values().stream()
.mapToLong(countDownTimer -> countDownTimer.timeLeft(TimeUnit.MILLISECONDS)).min()
.getAsLong();
}
if (!deferred.isEmpty()) {
waitTime = deferred.values().stream()
.mapToLong(countDownTimer -> countDownTimer.timeLeft(TimeUnit.MILLISECONDS)).min()
.getAsLong();
}

if (waitTime > 0) {
Expand Down

0 comments on commit 3557252

Please sign in to comment.