public abstract class WaitHandle : MarshalByRefObject, IDisposable
|
Use the static methods of this class to block a thread until one or more synchronization objects receive a signal.
ctor #1 | Default constructor. This constructor is called by derived class constructors to initialize state in this type. Initializes a new instance of the WaitHandle class. |
WaitTimeout | Indicates that a WaitHandle.WaitAny operation has timed out before any of the wait handles fire. This field is constant. |
Handle | Read-write Gets or sets the native operating system handle. |
Close | When overridden in a derived class, releases all resources held by the current WaitHandle. |
CreateObjRef (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetLifetimeService (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
InitializeLifetimeService (inherited from System.MarshalByRefObject) |
See base class member description: System.MarshalByRefObject.InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
WaitAll | Overloaded:WaitAll(WaitHandle[] waitHandles) Waits for all of the elements in the specified array to receive a signal. |
WaitAll | Overloaded:WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) Waits for all of the elements in the specified array to receive a signal, using an Int32 value to measure the time interval and specifying whether to exit the synchronization domain before the wait. |
WaitAll | Overloaded:WaitAll(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) Waits for all of the elements in the specified array to receive a signal, using a TimeSpan value to measure the time interval and specifying whether to exit the synchronization domain before the wait. |
WaitAny | Overloaded:WaitAny(WaitHandle[] waitHandles) Waits for any of the elements in the specified array to receive a signal. |
WaitAny | Overloaded:WaitAny(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to measure the time interval, and specifying whether to exit the synchronization domain before the wait. |
WaitAny | Overloaded:WaitAny(WaitHandle[] waitHandles, TimeSpan timeout, bool exitContext) Waits for any of the elements in the specified array to receive a signal, using a TimeSpan to measure the time interval and specifying whether to exit the synchronization domain before the wait. |
WaitOne | Overloaded:WaitOne() When overridden in a derived class, blocks the current thread until the current WaitHandle receives a signal. |
WaitOne | Overloaded:WaitOne(int millisecondsTimeout, bool exitContext) When overridden in a derived class, blocks the current thread until the current WaitHandle receives a signal, using 32-bit signed integer to measure the time interval and specifying whether to exit the synchronization domain before the wait. |
WaitOne | Overloaded:WaitOne(TimeSpan timeout, bool exitContext) When overridden in a derived class, blocks the current thread until the current instance receives a signal, using a TimeSpan to measure the time interval and specifying whether to exit the synchronization domain before the wait. |
InvalidHandle | Represents an invalid handle that was passed to a method. This field is read-only. |
Dispose | When overridden in a derived class, releases the unmanaged resources used by the WaitHandle, and optionally releases the managed resources. |
Finalize | Overridden: Releases the resources held by the current instance. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public WaitHandle(); |
protected static readonly IntPtr InvalidHandle;
|
public const int WaitTimeout;
|
public virtual IntPtr Handle {get; set;}
|
Exception Type | Condition |
---|---|
SecurityException | The caller does not have the required permission. |
public virtual void Close(); |
This method releases any unmanaged resources held by the current instance. This method can, but is not required to, suppress finalization during garbage collection by calling the GC.SuppressFinalize method.
Override this method to release resources allocated in derived classes.
Use this method to release all resources held by an instance of WaitHandle. Once this method is called, references to the current instance cause undefined behavior.
requestedType
Exception Type | Condition |
---|---|
RemotingException | This instance is not a valid remoting object. |
protected virtual void Dispose( |
explicitDisposing
When the explicitDisposing parameter is true, this method releases all resources held by any managed objects that this WaitHandle references. This method invokes the Dispose() method of each referenced object.
Dispose can be called multiple times by other objects. When overriding this method, be careful not to reference objects that have been previously disposed in an earlier call to Dispose or Close.
~WaitHandle(); |
public virtual int GetHashCode(); |
public object GetLifetimeService(); |
public Type GetType(); |
public virtual object InitializeLifetimeService(); |
public class MyClass : MarshalByRefObject { public override Object InitializeLifetimeService() { ILease lease = (ILease)base.InitializeLifetimeService(); if (lease.CurrentState == LeaseState.Initial) { lease.InitialLeaseTime = TimeSpan.FromMinutes(1); lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); lease.RenewOnCallTime = TimeSpan.FromSeconds(2); } return lease; } }
protected object MemberwiseClone(); |
public virtual string ToString(); |
public static bool WaitAll( |
waitHandles
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array are null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public static bool WaitAll( |
waitHandles
millisecondsTimeout
exitContext
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array is null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public static bool WaitAll( |
waitHandles
timeout
exitContext
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array is null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public static int WaitAny( |
waitHandles
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array is null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public static int WaitAny( |
waitHandles
millisecondsTimeout
exitContext
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array is null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public static int WaitAny( |
waitHandles
timeout
exitContext
Exception Type | Condition |
---|---|
ArgumentNullException | The waitHandles parameter is null or one or more of the objects in the waitHandles array is null. |
DuplicateWaitObjectException | The waitHandles array contains elements that are duplicates. |
NotSupportedException | The number of objects in waitHandles is greater than the system permits. |
public virtual bool WaitOne(); |
Override this method to customize the behavior of derived classes.
millisecondsTimeout
exitContext
Override this method to customize the behavior of derived classes.
timeout
exitContext
Override this method to customize the behavior of derived classes.