class · System.Threading

Thread

public class System.Threading.Thread : System.Any

A thread of its own running a function: new Thread(() => …), Start, Join.

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

Herencia

Clases base
Any Thread

Constructores

constructor Thread(body: func<> : void)
#

Propiedades

property IsAlive: bool
#

read-only

Started and not finished.

property ManagedThreadId: i32
#

read-only

Its number (0 until it runs): the main thread's is 1.

static property CurrentId: i32
#

static read-only

The number of the thread that asks.

Métodos

method Start() -> void
#

Starts the thread (once).

method Join() -> void
#

Waits until the thread has finished.

method Join(milliseconds: i32) -> bool
#

Waits at most milliseconds: whether the thread has finished.

static method Sleep(milliseconds: i32) -> void
#

static

Sleeps milliseconds (other threads run).

static method Yield() -> void
#

static

Lets another thread run.

static method SpinWait(iterations: i32) -> void
#

static

Waits a little without giving the processor up (in a loop that waits for another thread).

Miembros privados e internos (12)

field body: func<> : void
#

private

field handle: i64
#

private

field state: i32
#

private

0 not started, 1 started, 2 joined.

private

field number: i32
#

private

static method StartNative(body: func<> : void) -> i64
#

private static

static method JoinNative(handle: i64, milliseconds: i64) -> i64
#

private static

static method CurrentNative() -> i64
#

private static

static method YieldNative() -> void
#

private static

static method SleepFor(milliseconds: i64) -> void
#

private static

static method Misused(what: System.String<u8>) -> void
#

private static

method Run() -> void
#

private

What the new thread runs: the function, then it says it is done.

Miembros heredados (5)

Código fuente

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

System.Threading.Thread.hir
// A thread of its own running a function: `new Thread(() => …)`, Start, Join.
public class System.Threading.Thread : System.Any
{
    field body: func<> : void
    field handle: i64
    // 0 not started, 1 started, 2 joined.
    field state: i32
    field done: System.Threading.AtomicI32
    field number: i32
    static method StartNative(body: func<> : void) -> i64
    static method JoinNative(handle: i64, milliseconds: i64) -> i64
    static method CurrentNative() -> i64
    static method YieldNative() -> void
    static method SleepFor(milliseconds: i64) -> void
    static method Misused(what: System.String<u8>) -> void
    // What the new thread runs: the function, then it says it is done.
    method Run() -> void
    constructor Thread(body: func<> : void)
    // Starts the thread (once).
    method Start() -> void
    // Waits until the thread has finished.
    method Join() -> void
    // Waits at most `milliseconds`: whether the thread has finished.
    method Join(milliseconds: i32) -> bool
    // Sleeps `milliseconds` (other threads run).
    static method Sleep(milliseconds: i32) -> void
    // Lets another thread run.
    static method Yield() -> void
    // Waits a little without giving the processor up (in a loop that waits for another thread).
    static method SpinWait(iterations: i32) -> void
    // Started and not finished.
    property IsAlive: bool
    // Its number (0 until it runs): the main thread's is 1.
    property ManagedThreadId: i32
    // The number of the thread that asks.
    static property CurrentId: i32
}
Esc