class · System.Threading

SemaphoreSlim

public class System.Threading.SemaphoreSlim : System.Any

Counts permits: Wait takes one (waiting while there are none), Release gives them back.

Tipo
class
Espacio de nombres
System.Threading
Ensamblado
System.Core
Acceso
public, final
Archivo fuente
Threading.ant

Herencia

Clases base
Any SemaphoreSlim

Constructores

constructor SemaphoreSlim(initialCount: i32)
#
constructor SemaphoreSlim(initialCount: i32, maxCount: i32)
#

Propiedades

property CurrentCount: i32
#

read-only

Métodos

method Wait() -> void
#
method Wait(milliseconds: i32) -> bool
#

Waits at most milliseconds: whether it took a permit.

method Release(releaseCount: i32) -> i32
#

Gives releaseCount permits back: the count before.

method Release() -> i32
#
method Dispose() -> void
#

Frees what it holds (it must not be used after).

Miembros privados e internos (4)

field mutex: System.Threading.Mutex
#

private

field changed: System.Threading.Condition
#

private

field count: i32
#

private

field most: i32
#

private

Miembros heredados (5)

Código fuente

SemaphoreSlim en Larva HIR, descompilado a partir de su Larva HIR.

System.Threading.SemaphoreSlim.hir
// Counts permits: Wait takes one (waiting while there are none), Release gives them back.
public class System.Threading.SemaphoreSlim : System.Any
{
    field mutex: System.Threading.Mutex
    field changed: System.Threading.Condition
    field count: i32
    field most: i32
    constructor SemaphoreSlim(initialCount: i32)
    constructor SemaphoreSlim(initialCount: i32, maxCount: i32)
    method Wait() -> void
    // Waits at most `milliseconds`: whether it took a permit.
    method Wait(milliseconds: i32) -> bool
    // Gives `releaseCount` permits back: the count before.
    method Release(releaseCount: i32) -> i32
    method Release() -> i32
    // Frees what it holds (it must not be used after).
    method Dispose() -> void
    property CurrentCount: i32
}
Esc