public void Shutdown(bool wait = true) { lock (Lock) { _state = ThreadState.StopRequested; } ShutdownEvent.Set(); ResumeEvent.Set(); Thread.Join(); }
public bool ExecuteContext(IThreadContext context) { bool successfulInvoke = false; lock (Lock) { successfulInvoke = context != null && _state == ThreadState.Suspended; if (successfulInvoke) { Context = context; _state = ThreadState.Running; ResumeEvent.Set(); } } return(successfulInvoke); }
public void Resuming() { Contract.Assert(isPaused); isPaused = false; ResumeEvent.Set(); }
public void Resuming() { Debug.Assert(isPaused); isPaused = false; ResumeEvent.Set(); }
public void Resume() { PauseEvent.Reset(); ResumeEvent.Set(); }