Class JmcAtomicReference<V>

java.lang.Object
org.mpi_sws.jmc.api.util.concurrent.JmcAtomicReference<V>
Type Parameters:
V - the type of the reference held by this atomic reference

public class JmcAtomicReference<V> extends Object
A redefinition of AtomicReference to support JMC model checking. This class provides atomic operations on a reference variable, ensuring thread safety through the use of a reentrant lock.
  • Constructor Details

    • JmcAtomicReference

      public JmcAtomicReference(V initialValue)
      Constructs a new JmcAtomicReference with the specified initial value.
      Parameters:
      initialValue - the initial value of the atomic reference
  • Method Details

    • compareAndSet

      public boolean compareAndSet(V expectedReference, V newReference)
      Constructs a new JmcAtomicReference with a null initial value.
    • get

      public V get()
    • set

      public void set(V newValue)
    • getAndSet

      public V getAndSet(V newValue)