class · System.Threading
Thread
public class System.Threading.Thread : System.Any
A thread of its own running a function: new Thread(() => …), Start, Join.
- Kind
- class
- Namespace
- System.Threading
- Assembly
- System.Core
- Access
- public, final
- Source file
Threading.ant
Inheritance
- Base classes
-
AnyThread
Constructors
constructor Thread(body: func<> : void)
#
Properties
Started and not finished.
Its number (0 until it runs): the main thread's is 1.
The number of the thread that asks.
Methods
method Start() -> void
#
Starts the thread (once).
method Join() -> void
#
Waits until the thread has finished.
Waits at most milliseconds: whether the thread has finished.
Sleeps milliseconds (other threads run).
static method Yield() -> void
#
Lets another thread run.
Waits a little without giving the processor up (in a loop that waits for another thread).
Private and internal members (12)
field body: func<> : void
#
0 not started, 1 started, 2 joined.
field done: System.Threading.AtomicI32
#
static method YieldNative() -> void
#
static method Misused(what: System.String<u8>) -> void
#
method Run() -> void
#
What the new thread runs: the function, then it says it is done.
Inherited members (5)
GetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
Thread as Larva HIR, decompiled from its Larva 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
}