Class Win32::Mutex
In: mutex.rb
Parent: Ipc

Methods

Classes and Modules

Class Win32::Mutex::Error

Constants

VERSION = '0.3.0'

Attributes

name  [R]  The name of the Mutex object.

Public Class methods

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

If the initial_owner value is true and the caller created the mutex, the calling thread obtains initial ownership of the mutex object. Otherwise, the calling thread does not obtain ownership of the mutex. This value is false by default.

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

The inherit attribute determines whether or not the mutex can be inherited by child processes.

Open an existing Mutex 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 Mutex.new, except that the option for initial_owner cannot be set (since it is already set). Also, this method will raise a Mutex::Error if the mutex doesn‘t already exist.

If you want "open or create" semantics, then use Mutex.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.

Returns whether or not the calling thread has initial ownership of the mutex object.

Releases ownership of the mutex.

[Validate]