Initializes a newly created EventWaitHandle object, specifying whether the wait handle is initially signaled, whether it resets automatically or manually, the name of a system synchronization event, and a bool variable whose value after the call indicates whether the named system event was created.
| C# | Visual Basic |
public EventWaitHandle( bool initialState, EventResetMode mode, string name, out bool createdNew )
Public Sub New ( _ initialState As Boolean, _ mode As EventResetMode, _ name As String, _ <OutAttribute> ByRef createdNew As Boolean _ )
- initialState (Boolean)
- true to set the initial state to signaled, false to set it to nonsignaled.
- mode (EventResetMode)
- An EventResetMode value that determines whether the event resets automatically or manually.
- name (String)
- The name of a system-wide synchronization event.
- createdNew ( Boolean %)
- When this method returns, contains true if the calling thread was granted initial ownership of the named system event; otherwise, false. This parameter is passed uninitialized.
If name is a null reference (Nothing in Visual Basic) or an empty string, a local EventWaitHandle is created.
If a system event with the name specified for the name parameter already exists, the initialState parameter is ignored.