700293207d
Using compound operations as well as increments and decrements on primitive fields are not atomic operations. Here when volatile primitive field is incremented or decremented, we run into data loss if threads interleave in steps of update. Refer: https://wiki.sei.cmu.edu/confluence/display/java/VNA02-J.+Ensure+that+compound+operations+on+shared+variables+are+atomic ### What changes were proposed in this pull request? Using `AtomicLong` instead of `long` ### Why are the changes needed? volatile primitive field is incremented or decremented, we run into data loss if threads interleave in steps of update. ### Does this PR introduce any user-facing change? No ### How was this patch tested? All Existing UT can pass with the Change Closes #27071 from ajithme/atomic. Authored-by: Ajith <ajith2489@gmail.com> Signed-off-by: Sean Owen <srowen@gmail.com> |
||
---|---|---|
.. | ||
kvstore | ||
network-common | ||
network-shuffle | ||
network-yarn | ||
sketch | ||
tags | ||
unsafe |