示例#1
0
        public void Shutdown(bool wait = true)
        {
            lock (Lock)
            {
                _state = ThreadState.StopRequested;
            }

            ShutdownEvent.Set();
            ResumeEvent.Set();
            Thread.Join();
        }
示例#2
0
        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();
 }
示例#4
0
 public void Resuming()
 {
     Debug.Assert(isPaused);
     isPaused = false;
     ResumeEvent.Set();
 }
示例#5
0
        public void Resume()
        {
            PauseEvent.Reset();

            ResumeEvent.Set();
        }