Thread
Lightweight thread creation and joining
Fn
Thread entry point function type
typedef U0* (*Fn)(U0*)It
Platform-specific thread handle
#if defined(_WIN32) || defined(_WIN64)
self {
HANDLE handle
}
#else
self {
pthread_t handle
}
#endifstart
Start a new thread running the given function
Thread start(Thread.Fn method, U0* arg)Parameters
method— The thread entry functionarg— Argument passed to the thread function
Returns — Thread handle — use with join
join
Wait for a thread to finish
U0 join(Thread thread)Parameters
thread— The thread to wait on