Exemple #1
0
        /// <summary>
        /// Signals all threads waiting on this condition.
        /// </summary>
        public void Signal()
        {
            // For signal, we iterate through all of the waiting threads and push the condition
            // id onto the stack for that particular thread. Once this is done, we are safe to
            // pulse the monitor to release waiting threads.
            foreach (string threadId in _waitingThreads)
            {
                _threadSignals.Push(threadId, _signalId);
            }

            _monitor.PulseAll();
        }