Interface UnixFSAtomicLong


public interface UnixFSAtomicLong
Interface which behaves similar to an AtomicLong, but with reduced functionality. This may be a pure memory based implementation, as backed by AtomicLong, or it may be backed by one obtained from UnixFSMemoryUtils.getAtomicLong(ByteBuffer)
  • Method Details

    • get

      long get()
      Gets the current value, atomically.
      Returns:
      the value
    • set

      default void set(long value)
      Sets the value of, atomically.
      Parameters:
      value - the value to set
    • compareAndSet

      boolean compareAndSet(long expect, long update)
      Compares and sets the value, atomically.
      Parameters:
      expect - the expected value
      update - the new value to update
      Returns:
      true if set, false otherwise
    • basic

      static UnixFSAtomicLong basic()
      Creates a basic UnixFSAtomicLong.
      Returns:
      a UnixFSAtomicLong instance
    • wrap

      static UnixFSAtomicLong wrap(AtomicLong atomicLong)
      Wraps an instance of AtomicLong into an instance of UnixFSAtomicLong.
      Returns:
      a UnixFSAtomicLong instance