internal void ProperShutdown() { //if (_eventQLowPriority != null) // lock (_eventQLowPriority) // _eventQLowPriority.Clear(); //if (_eventQHighPriority != null) // lock (_eventQLowPriority) // _eventQHighPriority.Clear(); //if (_eventStackLowPriority != null) // lock (_eventStackLowPriority) // _eventStackLowPriority.Clear(); //if (_eventStackHighPriority != null) // lock (_eventStackLowPriority) // _eventStackHighPriority.Clear(); _toProcess.Clear(); _cont = false; Util.Wake(WorkFinished); Util.Wake(WorkQueued); Util.Wake(StepTriggered); if (ProcessThread != null) { ProcessThread.Join(1000); } foreach (var thread in _threads) { if (thread.IsAlive) { Console.WriteLine("Killing " + thread.Name + ". Current task: " + _threadTasks[thread.Name]); thread.Abort(); } } }