Skip to content

Commit a6ef493

Browse files
authored
Better use of AtomicBoolean (#1210)
1 parent ba73b87 commit a6ef493

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/io/nats/client/impl/NatsConnectionWriter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ public void run() {
200200
sendMessageBatch(msg, dataPort, stats);
201201
}
202202

203-
if (flushBuffer.get()) {
204-
flushBuffer.set(false);
203+
if (flushBuffer.getAndSet(false)) {
205204
dataPort.flush();
206205
}
207206
}

0 commit comments

Comments
 (0)