public void Put(IMaterial material) { PeekMixture.AddMaterial(material); //m_executive.CurrentEventController.SuspendUntil(m_executive.Now + duration); if (m_waiters.Count > 0) { ScheduleProcessingOfGetters(); } }
public Mixture Get(double kilograms) { if (m_waiters.Count > 0 || PeekMixture.Mass < kilograms) { m_waiters.Add(m_executive.CurrentEventController); do { m_getProcessor.Resume(); m_executive.CurrentEventController.Suspend(); } while (PeekMixture.Mass < kilograms); m_waiters.RemoveAt(0); m_getProcessor.Resume(); } return((Mixture)PeekMixture.RemoveMaterial(kilograms)); }