Fix synchronization
This commit is contained in:
parent
4a5a42b7fd
commit
858d1f86a6
@ -37,10 +37,10 @@ class QueueToConsumer<T> implements IQueueToConsumer<T> {
|
|||||||
boolean crashed = true;
|
boolean crashed = true;
|
||||||
try {
|
try {
|
||||||
if (consumer.tryConsume(value)) {
|
if (consumer.tryConsume(value)) {
|
||||||
crashed = false;
|
|
||||||
shouldAdd = false;
|
shouldAdd = false;
|
||||||
preAddQueued.decrementAndGet();
|
preAddQueued.decrementAndGet();
|
||||||
}
|
}
|
||||||
|
crashed = false;
|
||||||
} finally {
|
} finally {
|
||||||
if (crashed) {
|
if (crashed) {
|
||||||
shouldAdd = false;
|
shouldAdd = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user