Mutex Constructor (Boolean, String, Boolean%)

For apps that target Windows Phone OS 7.0 and 7.1, do not use this member in your app. If you do, your code will throw a MethodAccessException. This member is security-critical, which restricts it to internal use by the .NET Framework for Windows Phone class library.

[SECURITY CRITICAL]

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Initializes a new instance of the Mutex class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, and a Boolean value that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex.

Namespace: System.Threading
Assembly: mscorlib (in mscorlib.dll)

Syntax

<SecurityCriticalAttribute> _
Public Sub New ( _
    initiallyOwned As Boolean, _
    name As String, _
    <OutAttribute> ByRef createdNew As Boolean _
)
[SecurityCriticalAttribute]
public Mutex(
    bool initiallyOwned,
    string name,
    out bool createdNew
)

Parameters

  • initiallyOwned
    Type: System..::.Boolean
    true to give the calling thread initial ownership of the named system mutex if the named system mutex is created as a result of this call; otherwise, false.
  • name
    Type: System..::.String
    The name of the Mutex. If the value is nullNothingnullptra null reference (Nothing in Visual Basic), the Mutex is unnamed.
  • createdNew
    Type: System..::.Boolean%
    When this method returns, contains a Boolean that is true if a local mutex was created (that is, if name is nullNothingnullptra null reference (Nothing in Visual Basic) or an empty string) or if the specified named system mutex was created; false if the specified named system mutex already existed. This parameter is passed uninitialized.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also

Reference

Mutex Class

Mutex Overload

System.Threading Namespace

Other Resources

Managed Threading

[9DD06E25-12C0-4A9E-855A-452DC83803E2]