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).
- Tipo
- class
- Espacio de nombres
- System.Threading
- Ensamblado
- System.Core
- Acceso
- public
- Archivo fuente
Threading.ant
Herencia
Constructores
constructor Mutex()
#
Propiedades
Métodos
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
#
Miembros privados e internos (6)
Miembros heredados (4)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Any
Código fuente
Mutex en Larva HIR, descompilado a partir de su 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
}