コード例 #1
0
 /// <summary>
 /// Set the value.
 /// </summary>
 /// <param name="val">The new value.</param>
 /// <param name="commitPoint">The transaction's commit point.</param>
 /// <param name="msecs">The clock time.</param>
 internal void SetValue(object val, long commitPoint, int msecs)
 {
     if (_tvals == null)
     {
         _tvals = new TVal(val, commitPoint, msecs);
     }
     else if (_faults.get() > 0)
     {
         _tvals = new TVal(val, commitPoint, msecs, _tvals);
         _faults.set(0);
     }
     else
     {
         _tvals = _tvals.Next;
         _tvals.SetValue(val, commitPoint, msecs);
     }
 }
コード例 #2
0
ファイル: Ref.cs プロジェクト: rpete4130/clojure-clr
        /// <summary>
        /// Set the value.
        /// </summary>
        /// <param name="val">The new value.</param>
        /// <param name="commitPoint">The transaction's commit point.</param>
        internal void SetValue(object val, long commitPoint)
        {
            int hcount = HistCount();

            if (_tvals == null)
            {
                _tvals = new TVal(val, commitPoint);
            }
            else if ((_faults.get() > 0 && hcount < _maxHistory) || hcount < _minHistory)
            {
                _tvals = new TVal(val, commitPoint, _tvals);
                _faults.set(0);
            }
            else
            {
                _tvals = _tvals.Next;
                _tvals.SetValue(val, commitPoint);
            }
        }