public void Dispose() { if (StaThread.IsAlive) { DispatcherSynchronizationContext.Post(_ => Dispatcher.ExitAllFrames(), null); StaThread.Join(); } }
/// <summary> /// Cleans up the scheduler by indicating that no more tasks will be queued. /// This method blocks until all threads successfully shutdown. /// </summary> public void Dispose() { if (StaThread.IsAlive) { Dispatcher.InvokeShutdown(); StaThread.Join(); } }