PulseAll() public static method

public static PulseAll ( object obj ) : void
obj object
return void
示例#1
0
        public void ProcessJobs()
        {
            if (Thread.CurrentThread != _thread)
            {
                throw new InvalidOperationException("Unable to process jobs on a different thread.");
            }

            lock (_queue)
            {
                // Process all jobs
                while (_queue.Count > 0)
                {
                    var action = _queue.Dequeue();

                    lock (action)
                    {
                        action(); //
                        ThreadMonitor.PulseAll(action);
                    }
                }
            }
        }
        /// <summary>
        /// Wake up all threads waiting on the monitor.
        /// </summary>
        public static void PulseAll(Object obj)
        {
            Monitor monitor = GetMonitorFromSyncBlock(obj);

            monitor.PulseAll();
        }
示例#3
0
 /// <summary>
 /// Notifies all waiting threads of a change in the object's state.
 /// </summary>
 public virtual void PulseAll() => SystemMonitor.PulseAll(this.SyncObject);
示例#4
0
 public void PulseAll()
 {
     lock (this) Monitor.PulseAll(this);
 }