Class Win32::Event
In: event.rb
Parent: Ipc

Methods

inheritable?   new   open   reset   set   signaled=  

Classes and Modules

Class Win32::Event::Error

Constants

VERSION = '0.5.0'

Attributes

initial_state  [R]  The initial state of the Event object. If true, the initial state is signaled. Otherwise, it is non-signaled.
manual_reset  [R]  Indicates whether or not the Event requires use of the ResetEvent() function set the state to nonsignaled.
name  [R]  The name of the Event object.

Public Class methods

Creates and returns new Event object. If name is omitted, the Event object is created without a name, i.e. it‘s anonymous.

If name is provided and it already exists, then it is opened instead and the manual_reset and initial_state parameters are ignored.

If the man_reset parameter is set to true, then it creates an Event object which requires use of the Event#reset method in order to set the state to non-signaled. If this parameter is false (the default) then the system automatically resets the state to non-signaled after a single waiting thread has been released.

If the init_state parameter is true, the initial state of the Event object is signaled; otherwise, it is nonsignaled (the default).

If the inherit parameter is true, then processes created by this process will inherit the handle. Otherwise they will not.

In block form this will automatically close the Event object at the end of the block.

Open an existing Event by name. The inherit argument sets whether or not the object was opened such that a process created by the CreateProcess() function (a Windows API function) can inherit the handle. The default is true.

This method is essentially identical to Event.new, except that the options for manual_reset and initial_state cannot be set (since they are already set). Also, this method will raise an Event::Error if the event doesn‘t already exist.

If you want "open or create" semantics, then use Event.new.

Public Instance methods

Returns whether or not the object was opened such that a process created by the CreateProcess() function (a Windows API function) can inherit the handle. The default is true.

Sets the Event object to a non-signaled state.

Sets the Event object to a signaled state.

Synonym for Event#reset if bool is false, or Event#set if bool is true.

[Validate]