Expand description
Runtime interface for threads.
Functions§
- twz_
rt_ futex_ wait - If the futex word pointed to by
word
is equal to expected, put the thread to sleep. This operation is atomic – the thread is enqueued on the sleep queue first, before the equality check. Returns false on timeout, true on all other cases. - twz_
rt_ futex_ wake - Wake up up to max threads waiting on
word
. If max is None, wake up all threads. - twz_
rt_ join_ thread - Wait for a thread to exit, optionally timing out.
- twz_
rt_ set_ thread_ name - Set the name of the calling thread.
- twz_
rt_ sleep - Sleep the calling thread for duration
dur
. - twz_
rt_ spawn_ thread - Spawn a thread. On success, that thread starts executing concurrently with the return of this function.
- twz_
rt_ tls_ get_ addr - Get the address of a given TLS variable.
- twz_
rt_ yield - Yield the calling thread.
Type Aliases§
- Atomic
Futex Word - Atomic futex word, for a linux-like thread wait.
- Futex
Word - Type of a linux-like wait point.
- Thread
Id - Runtime-internal thread ID.
- Thread
Spawn Args - Arguments to spawn.
- TlsDesc
- TLS desc
- TlsIndex
- Index of a TLS variable.