Thread module

thread_init

procedure · 1 overloadSource

Prepares thread to run proc. Start it with thread_start. Returns false when proc is null, the storage size is negative or an allocation fails.

thread_init :: (
    thread: *Thread,
    proc: Thread_Proc,
    temporary_storage_size: s32 = 16384,
    starting_storage: *Temporary_Storage = null,
    name := ""
) -> bool

Prepares thread to run proc. Start it with thread_start. Returns false when proc is null, the storage size is negative or an allocation fails.

Parameters

thread: *Thread
set up by this call. It has to stay where it is until thread_deinit.
proc: Thread_Proc
runs on the new thread and is given thread.
temporary_storage_size: s32
bytes of temporary storage for the thread. 0 gives it none.
starting_storage: *Temporary_Storage
storage to use instead of allocating temporary_storage_size bytes.
name := ""
for debuggers and tools that list threads.

Returns

bool