Provides Windows-specific API calls for cross-process Mutexes.
More...
|
static IntPtr | Create ([Localizable(false)] string name, out bool alreadyExists) |
| Creates a new (or opens an existing) mutex. More...
|
|
static bool | Probe ([Localizable(false)] string name) |
| Checks whether a specific mutex exists without opening a lasting handle. More...
|
|
static void | Close (IntPtr handle) |
| Closes an existing mutex handle. The mutex is destroyed if this is the last handle. More...
|
|
Provides Windows-specific API calls for cross-process Mutexes.
◆ Close()
static void NanoByte.Common.Native.WindowsMutex.Close |
( |
IntPtr |
handle | ) |
|
|
inlinestatic |
Closes an existing mutex handle. The mutex is destroyed if this is the last handle.
- Parameters
-
handle | The mutex handle to be closed. |
- Exceptions
-
PlatformNotSupportedException | This method is called on a platform other than Windows. |
◆ Create()
static IntPtr NanoByte.Common.Native.WindowsMutex.Create |
( |
[Localizable(false)] string |
name, |
|
|
out bool |
alreadyExists |
|
) |
| |
|
inlinestatic |
Creates a new (or opens an existing) mutex.
- Parameters
-
name | The name to be used as a mutex identifier. |
alreadyExists | true if an existing mutex was opened; false if a new one was created. |
- Returns
- The handle for the mutex. Can be used in Close. Will automatically be released once the process terminates.
- Exceptions
-
Win32Exception | The native subsystem reported a problem. |
PlatformNotSupportedException | This method is called on a platform other than Windows. |
◆ Probe()
static bool NanoByte.Common.Native.WindowsMutex.Probe |
( |
[Localizable(false)] string |
name | ) |
|
|
inlinestatic |
Checks whether a specific mutex exists without opening a lasting handle.
- Parameters
-
name | The name to be used as a mutex identifier. |
- Returns
true
if an existing mutex was found; false
if none existed.
- Exceptions
-
Win32Exception | The native subsystem reported a problem. |
PlatformNotSupportedException | This method is called on a platform other than Windows. |
The documentation for this class was generated from the following file:
- Common/Native/WindowsMutex.cs