Description
With JDK9+ we get more fine-grained memory model, hence we can go in between ordinary and volatile access.
InMemoryDataTree.state publishing is an area where we publish an effectively-final object, hence under safe publishing we can not order against all other volatiles if we use acquire/release locking. This helps JIT a bit, as it gives it more freedom to reorder memory access.
Use VarHandles to implement this, so that we do not use volatile access.