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)
struct It {
  HANDLE handle
}
#else
struct It {
  pthread_t handle
}
#endif

start

Start a new thread running the given function

Thread.It start(Thread.Fn method, U0* arg)

Parameters

  • method — The thread entry function
  • arg — 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