class · System.Threading
Mutex
public class System.Threading.Mutex : System.Any
A lock: one thread at a time between Lock and Unlock (not re-entrant: a thread that holds it must not lock it again).
Run(() => …) holds it around a function. Dispose frees its handle (an undisposed one is freed when the object dies).
- Kind
- class
- Namespace
- System.Threading
- Assembly
- System.Core
- Access
- public
- Source file
Threading.ant
Inheritance
Constructors
constructor Mutex()
#
Properties
Methods
method Lock() -> void
#
method Unlock() -> void
#
Takes it when no other thread holds it: whether it did.
method WaitOne() -> void
#
WaitOne and ReleaseMutex: the same as Lock and Unlock.
method ReleaseMutex() -> void
#
method Run(body: func<> : void) -> void
#
Runs body holding the lock.
method Dispose() -> void
#
Frees it (it must not be used after).
method destroy() -> void
#
Private and internal members (6)
Inherited members (4)
GetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Any
Source
Mutex as Larva HIR, decompiled from its Larva HIR.
// A lock: one thread at a time between Lock and Unlock (not re-entrant: a thread that holds it must not lock it again).
// `Run(() => …)` holds it around a function. Dispose frees its handle (an undisposed one is freed when the object dies).
public class System.Threading.Mutex : System.Any
{
field handle: i64
static method New() -> i64
static method LockNative(handle: i64) -> void
static method TryNative(handle: i64) -> i64
static method UnlockNative(handle: i64) -> void
static method Free(handle: i64) -> void
constructor Mutex()
method Lock() -> void
method Unlock() -> void
// Takes it when no other thread holds it: whether it did.
method TryLock() -> bool
// WaitOne and ReleaseMutex: the same as Lock and Unlock.
method WaitOne() -> void
method ReleaseMutex() -> void
// Runs `body` holding the lock.
method Run(body: func<> : void) -> void
// Frees it (it must not be used after).
method Dispose() -> void
method destroy() -> void
// The handle (for Condition).
property Handle: i64
}