NanoByte.Common
2.6.1
|
Provides a wrapper around Mutex that automatically acquires on creating and releases on Dispose. More...
Public Member Functions | |
MutexLock (string name) | |
Acquires Mutex with name . More... | |
void | Dispose () |
Releases the Mutex. More... | |
Provides a wrapper around Mutex that automatically acquires on creating and releases on Dispose.
Instead of lock (_object) { code(); }
for per-process locking use using (new MutexLock("name") { code(); }
for inter-process locking.
Automatically handles AbandonedMutexException with Log.Warn(Exception).
|
inline |
Acquires Mutex with name .
|
inline |
Releases the Mutex.