public void RequestStop() { lock (mWorkerThreadSemaphore) { if (mWorkerThread != null) { mWorkerThread.CancelAsync(); } foreach (CancellationTokenSource t in cancelTokenList) { t.Cancel(); } } lock (mEndlessThreadSemaphore) { if (mEndlessThread != null) { mEndlessThread.CancelAsync(); } } }