Class MutexLock
[MustDisposeResource]
public sealed class MutexLock : IDisposable
- Inheritance
-
objectMutexLock
- Implements
- Extension Methods
Examples
Instead of lock (_object) { code(); } for per-process locking use
using (new MutexLock("name") { code(); } for inter-process locking.
Remarks
Automatically handles AbandonedMutexException with Warn(string, Exception?).
Constructors
MutexLock(string)
Acquires Mutex with name.
public MutexLock(string name)
Parameters
namestring
Methods
Dispose()
Releases the Mutex.
public void Dispose()
Remarks
Must be called from the same thread that instantiated this object.