コード例 #1
0
 public Promise(bool done)
 {
     _exception = null;
     _hashCode  = base.GetHashCode();
     if (!done)
     {
         _waitHandle = new ManualResetEventSlim(false);
     }
 }
コード例 #2
0
        private static bool EqualsExtracted(StructNeedle <T> left, StructNeedle <T> right)
        {
            var leftValue = left.Value;

            if (left.IsAlive)
            {
                var rightValue = right.Value;
                return(right.IsAlive && EqualityComparer <T> .Default.Equals(leftValue, rightValue));
            }
            return(!right.IsAlive);
        }
コード例 #3
0
 public Promise(Exception exception)
 {
     _exception  = exception;
     _hashCode   = exception.GetHashCode();
     _waitHandle = new ManualResetEventSlim(true);
 }
コード例 #4
0
 public bool Equals(StructNeedle <T> other)
 {
     return(EqualsExtracted(this, other));
 }