Skip to content

Commit

Permalink
Better use of AtomicBoolean (#1210)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf authored Aug 19, 2024
1 parent ba73b87 commit a6ef493
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/io/nats/client/impl/NatsConnectionWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ public void run() {
sendMessageBatch(msg, dataPort, stats);
}

if (flushBuffer.get()) {
flushBuffer.set(false);
if (flushBuffer.getAndSet(false)) {
dataPort.flush();
}
}
Expand Down

0 comments on commit a6ef493

Please sign in to comment.