System.Threading.Barrier.SetResetEvents C# (CSharp) Method

SetResetEvents() private method

Sets the current phase event and reset the next phase event
private SetResetEvents ( bool observedSense ) : void
observedSense bool The current phase sense
return void
        private void SetResetEvents(bool observedSense)
        {
            // Increment the phase count using Volatile class because m_currentPhase is 64 bit long type, that could cause torn write on 32 bit machines
            CurrentPhaseNumber = CurrentPhaseNumber + 1;
            if (observedSense)
            {
                _oddEvent.Reset();
                _evenEvent.Set();
            }
            else
            {
                _evenEvent.Reset();
                _oddEvent.Set();
            }
        }