コード例 #1
0
        public void Paused()
        {
            Contract.Assert(!isPaused);

            if (ResumeEvent == null)
            {
                ResumeEvent = new ManualResetEvent(false);
            }
            else
            {
                ResumeEvent.Reset();
            }

            Timer.Pause();

            // Set IsPaused at the last as other threads seeing it set, will expect a valid
            // reset ResumeEvent. Also the requirement here is that only after Paused
            // returns other threads should block on this event. So there is a race condition here.
            isPaused = true;
        }
コード例 #2
0
ファイル: QueueEvents.cs プロジェクト: GeneSpainhour/Felix
        public void Pause()
        {
            ResumeEvent.Reset();

            PauseEvent.Set();
        }