Class BaseGammaTxnRef

    • Field Detail

      • type

        public final int type
      • long_value

        public volatile long long_value
      • ref_value

        public volatile java.lang.Object ref_value
    • Constructor Detail

      • BaseGammaTxnRef

        protected BaseGammaTxnRef​(GammaStm stm,
                                  int type)
    • Method Detail

      • flattenCommute

        public final boolean flattenCommute​(GammaTxn tx,
                                            Tranlocal tranlocal,
                                            int lockMode)
      • load

        public final boolean load​(GammaTxn tx,
                                  Tranlocal tranlocal,
                                  int lockMode,
                                  int spinCount,
                                  boolean arriveNeeded)
      • openForCommute

        public final void openForCommute​(GammaTxn tx,
                                         Function function)
      • ensure

        public final void ensure()
      • ensure

        public final void ensure​(Txn self)
      • ensure

        public final void ensure​(GammaTxn tx)
      • getObject

        protected final java.lang.Object getObject​(GammaTxn tx,
                                                   LockMode lockMode)
      • setLong

        protected final long setLong​(GammaTxn tx,
                                     LockMode lockMode,
                                     long newValue,
                                     boolean returnOld)
      • setObject

        protected final java.lang.Object setObject​(GammaTxn tx,
                                                   LockMode lockMode,
                                                   java.lang.Object newValue,
                                                   boolean returnOld)
      • atomicGetLong

        public final long atomicGetLong()
      • atomicObjectGet

        public final java.lang.Object atomicObjectGet()
      • atomicSetLong

        public final long atomicSetLong​(long newValue,
                                        boolean returnOld)
      • atomicSetObject

        public final java.lang.Object atomicSetObject​(java.lang.Object newValue,
                                                      boolean returnOld)
      • atomicCompareAndSetLong

        public final boolean atomicCompareAndSetLong​(long expectedValue,
                                                     long newValue)
      • acquire

        public final void acquire​(LockMode desiredLockMode)
        Description copied from interface: Lock
        Acquires a Lock with the provided LockMode. This call doesn't block if the Lock can't be upgraded, but throws a ReadWriteConflict. It could also be that the Lock is acquired, but the Txn sees that it isn't consistent anymore. In that case also a ReadWriteConflict is thrown.

        This call makes use of the Txn stored in the TxnThreadLocal.

        If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.

        Parameters:
        desiredLockMode - the desired lockMode.
      • acquire

        public final void acquire​(Txn tx,
                                  LockMode desiredLockMode)
        Description copied from interface: Lock
        Acquires a Lock with the provided LockMode using the provided transaction. This call doesn't block if the Lock can't be upgraded but throws a ReadWriteConflict. It could also be that the Lock is acquired, but the Txn sees that it isn't consistent anymore. In that case also a ReadWriteConflict is thrown.

        If the lockMode is lower than the LockMode the transaction already has on this Lock, the call is ignored.

        Parameters:
        tx - the Txn used for this operation.
        desiredLockMode - the desired lockMode.
      • tryLockAndCheckConflict

        public final boolean tryLockAndCheckConflict​(GammaTxn tx,
                                                     Tranlocal tranlocal,
                                                     int spinCount,
                                                     int desiredLockMode)
        Tries to acquire a lock on a previous read/written tranlocal and checks for conflict.

        If the lockMode == LOCKMODE_NONE, this call is ignored.

        The call to this method can safely made if the current lock level is higher the the desired LockMode.

        If the can't be acquired, no changes are made on the tranlocal.

        Parameters:
        tx -
        tranlocal - the tranlocal
        spinCount - the maximum number of times to spin
        desiredLockMode -
        Returns:
        true if the lock was acquired successfully and there was no conflict.
      • hasReadConflict

        public final boolean hasReadConflict​(Tranlocal tranlocal)
      • arriveAndExclusiveLockOrBackoff

        protected final int arriveAndExclusiveLockOrBackoff()