Thread module

init

procedure · 3 overloadsSource

Sets up a mutex. It is recursive: the thread that holds it can lock it again, and has to unlock it as many times.

init :: (m: *Mutex, desired_name := "", desired_order: Mutex_Order = -1)

Sets up a mutex. It is recursive: the thread that holds it can lock it again, and has to unlock it as many times.

Parameters

m: *Mutex
desired_name := ""
a label for the mutex. Only kept in builds with DEBUG set.
desired_order: Mutex_Order
a rank for the mutex. Only kept in builds with DEBUG set; nothing acts on it yet. -1 for none.
init :: (cv: *Condition_Variable, desired_name := "")

Sets up a condition variable.

Parameters

desired_name := ""
a label for the condition variable. Only kept in builds with DEBUG set.
init :: (s: *Semaphore, initial_value: s32 = 0)

Sets up a semaphore.

Parameters

initial_value: s32
how many wait_for calls succeed before anyone calls signal.

See also