Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
use an AtomicBoolean instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed May 10, 2018
1 parent 41c8e0e commit 2b72a3e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.lmax.disruptor.dsl.ProducerType;
import io.opencensus.implcore.internal.DaemonThreadFactory;
import io.opencensus.implcore.internal.EventQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -162,12 +163,11 @@ public void enqueue(Entry entry) {
public void shutdown() {
enqueuer =
new DisruptorEnqueuer() {
boolean logged = false;
final AtomicBoolean logged = new AtomicBoolean(false);

@Override
public void enqueue(Entry entry) {
if (!logged) {
logged = true;
if (!logged.getAndSet(true)) {
logger.log(Level.INFO, "Attempted to enqueue entry after Disruptor shutdown.");
}
}
Expand Down

0 comments on commit 2b72a3e

Please sign in to comment.