public void SignalToStop() { // stop thread if (thread != null) { // signal to stop needToStop = true; } }