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

Wait() public static method

public static Wait ( object obj ) : bool
obj object
return bool
		public static bool Wait (object obj)
		{
			return Wait (obj, Timeout.Infinite);
		}

Same methods

Monitor::Wait ( object obj, System.TimeSpan timeout ) : bool
Monitor::Wait ( object obj, System.TimeSpan timeout, bool exitContext ) : bool
Monitor::Wait ( object obj, int millisecondsTimeout ) : bool
Monitor::Wait ( object obj, int millisecondsTimeout, bool exitContext ) : bool

Usage Example

Esempio n. 1
0
        public void Invoke(Action action)
        {
            // Execute now if already on the thread
            if (Thread.CurrentThread == _thread)
            {
                action();
            }
            else
            {
                lock (action)
                {
                    // Schedule action
                    InvokeLater(action);

                    // Wait for action to complete
                    ThreadMonitor.Wait(action);
                }
            }
        }
All Usage Examples Of System.Threading.Monitor::Wait