Use VarHandles to update shortest/longest duration 53/103153/4
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Nov 2022 16:36:54 +0000 (17:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Nov 2022 16:55:28 +0000 (17:55 +0100)
commite82e8ad73f615c86d4ed64673fa02590dbe62c5d
treefb4293658fda42a294b92c507372195948f91b13
parent5b2d859eb5b0e9ec84c138a983d93e58d47a6c46
Use VarHandles to update shortest/longest duration

Rather than using ARFU's compareAndSet() and volatile reads, take
advantage of VarHandle's getAcquire() and compareAndExchangeRelease().
This makes things less ordered and more performant in face of races.
Also split out the update logic to aid inlining.

Change-Id: If60016b03c738240d7bdc041c32d5d908b3f002c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/util/src/main/java/org/opendaylight/yangtools/util/ConcurrentDurationStatisticsTracker.java