// Implicitly kills the processing thread and waits for it to join before returning public void KillCommunicationThreadAndWait() { KillCommunicationThreadFlag = true; if (CommunicationThread.IsAlive) { CommunicationThread.Join(); } }
// Implicitly kills the processing thread and waits for it to join before returning public void KillCommunicationThreadAndWait() { CommunicationMutex.WaitOne(); KillCommunicationThreadFlag = true; CommunicationMutex.ReleaseMutex(); CommunicationThread.Join(); }