bool IMultiTreeHandleable.Handle(IValueContainer valueContainer, Promise owner, int index) { bool done = --_waitCount == 0; bool handle = false; if (_valueOrPrevious == null) { owner._wasWaitedOn = true; if (owner._state != State.Resolved | done) { valueContainer.Retain(); _valueOrPrevious = valueContainer; handle = true; } else { IncrementProgress(owner); } } if (done) { while (_passThroughs.IsNotEmpty) { _passThroughs.Pop().Release(); } ReleaseInternal(); } return(handle); }
void ITreeHandleable.MakeReadyFromSettled(IValueContainer valueContainer) { if (valueContainer.GetState() == State.Canceled) { valueContainer.Retain(); _valueContainer = valueContainer; AddToCancelQueueBack(this); } else { Dispose(); } }
void ITreeHandleable.MakeReady(IValueContainer valueContainer, ref ValueLinkedQueue <ITreeHandleable> handleQueue, ref ValueLinkedQueue <ITreeHandleable> cancelQueue) { if (valueContainer.GetState() == State.Canceled) { valueContainer.Retain(); _valueContainer = valueContainer; cancelQueue.Push(this); } else { Dispose(); } }
bool IMultiTreeHandleable.Handle(IValueContainer valueContainer, Promise owner, int index) { bool handle = _valueOrPrevious == null; if (handle) { owner._wasWaitedOn = true; valueContainer.Retain(); _valueOrPrevious = valueContainer; } if (--_waitCount == 0) { while (_passThroughs.IsNotEmpty) { _passThroughs.Pop().Release(); } ReleaseInternal(); } return(handle); }
public void SetValue(IValueContainer valueContainer) { valueContainer.Retain(); _valueContainer = valueContainer; }