MutexGuard<T>
Struct · namespace System · Since 0.04
struct MutexGuard<T> : IDisposableHolds the lock of a Mutex<T> until Dispose(). Copies of a guard share the “held” flag, so the lock is released once. A guard cannot be passed to another thread (the thread that locked a mutex has to unlock it).
Methods
Section titled “Methods”| Name | Description |
|---|---|
Get |
A copy of the guarded value. |
Set |
Replaces the guarded value. |
Dispose |
Releases the lock (once; disposing a guard again does nothing). |
T Get()A copy of the guarded value.
Panics when the guard was disposed already.
void Set(T value)Replaces the guarded value.
Panics when the guard was disposed already.
Dispose
Section titled “Dispose”void Dispose()Releases the lock (once; disposing a guard again does nothing).