C# Class NanoByte.Common.Native.WindowsMutex

Provides Windows-specific API calls for cross-process Mutexes.
Datei anzeigen Open project: nano-byte/common

Public Methods

Method Description
Close ( IntPtr handle ) : void

Closes an existing mutex handle. The mutex is destroyed if this is the last handle.

Create ( [ name, IntPtr &handle ) : bool

Creates or opens a mutex.

The mutex will automatically be released once the process terminates.

Open ( [ name ) : bool

Tries to open an existing mutex.

Opening a mutex creates an additional handle to it, keeping it alive until the process terminates.

Probe ( [ name ) : bool

Checks whether a specific mutex exists without openining a lasting handle.

Method Details

Close() public static method

Closes an existing mutex handle. The mutex is destroyed if this is the last handle.
This method is called on a platform other than Windows.
public static Close ( IntPtr handle ) : void
handle System.IntPtr The mutex handle to be closed.
return void

Create() public static method

Creates or opens a mutex.
The mutex will automatically be released once the process terminates.
The native subsystem reported a problem. This method is called on a platform other than Windows.
public static Create ( [ name, IntPtr &handle ) : bool
name [ The name to be used as a mutex identifier.
handle System.IntPtr The handle created for the mutex. Can be used to close it before the process ends.
return bool

Open() public static method

Tries to open an existing mutex.
Opening a mutex creates an additional handle to it, keeping it alive until the process terminates.
The native subsystem reported a problem. This method is called on a platform other than Windows.
public static Open ( [ name ) : bool
name [ The name to be used as a mutex identifier.
return bool

Probe() public static method

Checks whether a specific mutex exists without openining a lasting handle.
The native subsystem reported a problem. This method is called on a platform other than Windows.
public static Probe ( [ name ) : bool
name [ The name to be used as a mutex identifier.
return bool