static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); m_MainWindow = new FormMain(); m_EmulatorWorker = new EmulatorWorker(); System.Threading.Thread workerThread = new System.Threading.Thread(m_EmulatorWorker.DoWork); workerThread.Priority = System.Threading.ThreadPriority.AboveNormal; workerThread.Start(); Application.Run(m_MainWindow); m_EmulatorWorker.StopWorker(); while (!workerThread.IsAlive) ; }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); m_MainWindow = new FormMain(); m_EmulatorWorker = new EmulatorWorker(); System.Threading.Thread workerThread = new System.Threading.Thread(m_EmulatorWorker.DoWork); workerThread.Priority = System.Threading.ThreadPriority.AboveNormal; workerThread.Start(); Application.Run(m_MainWindow); m_EmulatorWorker.StopWorker(); while (!workerThread.IsAlive) { ; } }