private void NonBlockingPost(ITuple tuple) { m_ts.Add(tuple.Key, tuple); tuple.OnPosted(this); TuplePosted?.Invoke(this, tuple); foreach (IDetachableEventController idec in m_waitersToRead[tuple.Key]) { idec.Resume(_readPriority); } foreach (IDetachableEventController idec in m_waitersToTake[tuple.Key]) { idec.Resume(s_takePriority); } m_waitersToRead.Remove(tuple.Key); m_waitersToTake.Remove(tuple.Key); }
public void Post(ITuple tuple) { m_ts.Add(tuple.Key, tuple); tuple.OnPosted(this); if (TuplePosted != null) { TuplePosted(this, tuple); } IList wtr = m_waitersToRead[tuple.Key]; IList wtt = m_waitersToTake[tuple.Key]; m_waitersToRead.Clear(tuple.Key); m_waitersToTake.Clear(tuple.Key); foreach (IDetachableEventController idec in wtr) { idec.Resume(double.MaxValue); } foreach (IDetachableEventController idec in wtt) { idec.Resume(double.MaxValue - double.Epsilon); } }