lhotari commented on code in PR #22221: URL: https://github.com/apache/pulsar/pull/22221#discussion_r1565180673
########## pulsar-common/src/main/java/org/apache/pulsar/common/mutable/AtomicMutableBoolean.java: ########## Review Comment: > The value of Java's AtomicBoolean is modifier by volatile, it will reduce the performance. @poorbarcode Have you noticed that the field `currentLedgerTimeoutTriggered` itself is a `volatile`? `private volatile MutableBoolean currentLedgerTimeoutTriggered;`. That will "reduce performance" each time the field is read. Using `private final AtomicBoolean currentLedgerTimeoutTriggered = new AtomicBoolean(false);` would prevent that. Therefore I think that we shouldn't add the `AtomicMutableBoolean` class. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
