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);
                }
Example #2
0
 void ITreeHandleable.MakeReadyFromSettled(IValueContainer valueContainer)
 {
     if (valueContainer.GetState() == State.Canceled)
     {
         valueContainer.Retain();
         _valueContainer = valueContainer;
         AddToCancelQueueBack(this);
     }
     else
     {
         Dispose();
     }
 }
Example #3
0
 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();
     }
 }
Example #4
0
                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);
                }
Example #5
0
 public void SetValue(IValueContainer valueContainer)
 {
     valueContainer.Retain();
     _valueContainer = valueContainer;
 }