System.Threading.EventWaitHandle.OpenExisting Method

Opens the specified named synchronization event, if it already exists.

Syntax

public static EventWaitHandle OpenExisting (string name)

Parameters

name
The name of the system synchronization event to open.

Returns

An object that represents the named system event.

Remarks

The erload:System.Threading.EventWaitHandle.OpenExisting method tries to open the specified named system event. If the system event does not exist, this method throws an exception instead of creating the system event. To create the system event when it does not already exist, use one of the EventWaitHandle.#ctor(bool, EventResetMode, string, Boolean@, System.Security.AccessControl.EventWaitHandleSecurity) constructors that has a name parameter.

Multiple calls to this method that use the same value for name do not necessarily return the same System.Threading.EventWaitHandle object, even though the objects that are returned represent the same named system event.

This method overload is equivalent to calling the EventWaitHandle.OpenExisting(string, System.Security.AccessControl.EventWaitHandleRights) method overload and specifying System.Security.AccessControl.EventWaitHandleRights.Synchronize and System.Security.AccessControl.EventWaitHandleRights.Modify rights, combined by using the bitwise OR operation.

Specifying the System.Security.AccessControl.EventWaitHandleRights.Synchronize flag allows a thread to wait on the named system event, and specifying the System.Security.AccessControl.EventWaitHandleRights.Modify flag allows a thread to call the EventWaitHandle.Set and EventWaitHandle.Reset methods.

Requirements

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0