Esempio n. 1
0
 /// <summary>
 /// Touch the reference.  (Add to the tracking list in the current transaction.)
 /// </summary>
 public void touch()
 {
     LockingTransaction.getEx().doTouch(this);
 }
Esempio n. 2
0
 /// <summary>
 /// Apply a commute to the reference. (Must be in a transaction.)
 /// </summary>
 /// <param name="fn">The function to apply to the current state and additional arguments.</param>
 /// <param name="args">Additional arguments.</param>
 /// <returns>The computed value.</returns>
 public object commute(IFn fn, ISeq args)
 {
     return(LockingTransaction.getEx().doCommute(this, fn, args));
 }
Esempio n. 3
0
        /// <summary>
        /// Change to a computed value.
        /// </summary>
        /// <param name="fn">The function to apply to the current state and additional arguments.</param>
        /// <param name="args">Additional arguments.</param>
        /// <returns>The computed value.</returns>
        public object alter(IFn fn, ISeq args)
        {
            LockingTransaction t = LockingTransaction.getEx();

            return(t.doSet(this, fn.applyTo(RT.cons(t.doGet(this, _tvals), args))));
        }
Esempio n. 4
0
 /// <summary>
 /// Set the value (must be in a transaction).
 /// </summary>
 /// <param name="val">The new value.</param>
 /// <returns>The new value.</returns>
 public object set(object val)
 {
     return(LockingTransaction.getEx().doSet(this, val));
 }