public void Dispose() { m_IsDisposing = true; while (Interlocked.Read(ref m_TasksInProgress) > 0) { Thread.Sleep(100); } m_SchedulingStrategy.Dispose(); }