WaitHandle Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Encapsulates operating system–specific objects that wait for exclusive access to shared resources.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

[<AbstractClass>]
type WaitHandle =  
    class
        inherit MarshalByRefObject
    end

The WaitHandle type exposes the following members.

  NameDescription
Protected methodWaitHandleInitializes a new instance of the WaitHandle class.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberWaitAll(array<WaitHandle>[]()[][])Waits for all the elements in the specified array to receive a signal.
Public methodStatic memberWaitAll(array<WaitHandle>[]()[][], Int32, Boolean)Waits for all the elements in the specified array to receive a signal, using an Int32 value to specify the time interval and specifying whether to exit the synchronization domain before the wait.
Public methodStatic memberWaitAny(array<WaitHandle>[]()[][])Waits for any of the elements in the specified array to receive a signal.
Public methodStatic memberWaitAny(array<WaitHandle>[]()[][], Int32, Boolean)Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait.
Public methodWaitOne()()()()Blocks the current thread until the current WaitHandle receives a signal.
Public methodWaitOne(Int32, Boolean)Blocks the current thread until the current WaitHandle receives a signal, using a 32-bit signed integer to specify the time interval and specifying whether to exit the synchronization domain before the wait.
Top

  NameDescription
Public fieldStatic memberWaitTimeoutIndicates that a WaitAny operation timed out before any of the wait handles were signaled. This field is constant.
Top

This class is typically used as a base class for synchronization objects. Classes derived from WaitHandle define a signaling mechanism to indicate taking or releasing access to a shared resource, but use the inherited WaitHandle methods to block while waiting for access to shared resources.

Use the static methods of this class to block a thread until one or more synchronization objects receive a signal.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: