System.Threading.Monitor.PulseAll C# (CSharp) Method

PulseAll() public static method

public static PulseAll ( object obj ) : void
obj object
return void
		public static void PulseAll(object obj) {
			if(obj==null) {
				throw new ArgumentNullException("obj");
			}
			if(Monitor_test_synchronised(obj)==false) {
				throw new SynchronizationLockException("Object is not synchronized");
			}

			Monitor_pulse_all(obj);
		}

Usage Example

示例#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);
                    }
                }
            }
        }
All Usage Examples Of System.Threading.Monitor::PulseAll