Class MutexLock
Namespace: NanoByte.Common.Threading
Assembly: NanoByte.Common.dll
Syntax
public sealed class MutexLock : Object
Remarks
Automatically handles AbandonedMutexException with Warn(String, Exception).
Examples
Instead of lock (_object) { code(); }
for per-process locking use
using (new MutexLock("name") { code(); }
for inter-process locking.
Constructors
MutexLock(String)
Acquires Mutex with name
.
Declaration
public MutexLock(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name |
Methods
Dispose()
Releases the Mutex.
Declaration
public void Dispose()