public void setup() { _running = true; _runningThread = new Thread(() => { while (_running) { Thread.Sleep(1); } }); _runningThread.Start(); _actionCalled = false; _subject = new ThreadWatcher(_runningThread, TargetAction); }
/// <summary> /// Shut down messaging when the activating thread ends /// </summary> public static void Activate() { watcher = new ThreadWatcher(Thread.CurrentThread, ShutdownAction); }