public Promise(bool done) { _exception = null; _hashCode = base.GetHashCode(); if (!done) { _waitHandle = new ManualResetEventSlim(false); } }
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); }
public Promise(Exception exception) { _exception = exception; _hashCode = exception.GetHashCode(); _waitHandle = new ManualResetEventSlim(true); }
public bool Equals(StructNeedle <T> other) { return(EqualsExtracted(this, other)); }