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.
Inheritance Hierarchy
System. . :: . .Object
System. . :: . .MarshalByRefObject
System.Threading..::..WaitHandle
System.Threading. . :: . .AutoResetEvent
System.Threading. . :: . .ManualResetEvent
Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public MustInherit Class WaitHandle _
Inherits MarshalByRefObject
public abstract class WaitHandle : MarshalByRefObject
public ref class WaitHandle abstract : public MarshalByRefObject
[<AbstractClass>]
type WaitHandle =
class
inherit MarshalByRefObject
end
public abstract class WaitHandle extends MarshalByRefObject
The WaitHandle type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
WaitHandle | Initializes a new instance of the WaitHandle class. |
Top
Methods
Name | Description | |
---|---|---|
![]() |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() ![]() |
WaitAll(array<WaitHandle> [] () [] []) | Waits for all the elements in the specified array to receive a signal. |
![]() ![]() |
WaitAll(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. |
![]() ![]() |
WaitAny(array<WaitHandle> [] () [] []) | Waits for any of the elements in the specified array to receive a signal. |
![]() ![]() |
WaitAny(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. |
![]() |
WaitOne() () () () | Blocks the current thread until the current WaitHandle receives a signal. |
![]() |
WaitOne(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
Fields
Name | Description | |
---|---|---|
![]() ![]() |
WaitTimeout | Indicates that a WaitAny operation timed out before any of the wait handles were signaled. This field is constant. |
Top
Remarks
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.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.