Class VolatileReference<V>

  • Type Parameters:
    V - type of the wrapped variable

    public final class VolatileReference<V>
    extends Object
    This class is useful in case you need to pass a reference to a variable that might have not been initialized yet. The referenced variable is volatile to ensure that any change of the reference will get synchronized among threads.
    Author:
    Marek Potociar
    • Field Detail

      • value

        public volatile V value
    • Constructor Detail

      • VolatileReference

        public VolatileReference​(V value)