MutexAcl.OpenExisting(String, MutexRights) Method

Definition

Opens a specified named mutex, if it already exists, and applies the desired access rights.

public static System.Threading.Mutex OpenExisting (string name, System.Security.AccessControl.MutexRights rights);

Parameters

name
String

The name of the mutex to be opened. If it's prefixed by "Global", it refers to a machine-wide mutex. If it's prefixed by "Local", or doesn't have a prefix, it refers to a session-wide mutex. Both prefix and name are case-sensitive.

rights
MutexRights

The desired access rights to apply to the returned mutex.

Returns

An existing named mutex.

Exceptions

name is null.

name is an empty string.

The named mutex does not exist or is invalid.

The path was not found.

A Win32 error occurred.

The named mutex exists, but the user does not have the security access required to use it.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
Windows Desktop 6, 7, 8, 9