/// <summary> /// Gets the (immutable) value the reference is holding. /// </summary> /// <returns>The value</returns> public override object deref() { LockingTransaction t = LockingTransaction.GetRunning(); if (t == null) { object ret = currentVal(); //Console.WriteLine("Thr {0}, {1}: No-trans get => {2}", Thread.CurrentThread.ManagedThreadId,DebugStr(), ret); return(ret); } return(t.DoGet(this)); }
public object alter(IFn fn, ISeq args) { LockingTransaction t = LockingTransaction.GetEx(); return(t.DoSet(this, fn.applyTo(RT.cons(t.DoGet(this), args)))); }