Renci.SshNet.Common.CountdownEvent.Signal C# (CSharp) Method

Signal() public method

Registers a signal with the CountdownEvent, decrementing the value of CurrentCount.
The current instance has already been disposed. The current instance is already set.
public Signal ( ) : bool
return bool
        public bool Signal()
        {
            EnsureNotDisposed();

            if (_count <= 0)
                throw new InvalidOperationException("Invalid attempt made to decrement the event's count below zero.");

            var newCount = Interlocked.Decrement(ref _count);
            if (newCount == 0)
            {
                _event.Set();
                return true;
            }

            return false;
        }