Fix synchronization

This commit is contained in:
Andrea Cavalli 2022-11-10 00:40:48 +01:00
parent 4a5a42b7fd
commit 858d1f86a6

View File

@ -37,10 +37,10 @@ class QueueToConsumer<T> implements IQueueToConsumer<T> {
boolean crashed = true;
try {
if (consumer.tryConsume(value)) {
crashed = false;
shouldAdd = false;
preAddQueued.decrementAndGet();
}
crashed = false;
} finally {
if (crashed) {
shouldAdd = false;