Threading management module
This module features common threading and blocking principles. It contains thread merge operation based on stb_sync, as well as CPU affinity management.
Classes
- struct zpl_atomic32
- struct zpl_async_ctl
- struct zpl_thread
- struct zpl_sync
Typedefs
- using zpl_thread_proc = isize(*)(struct zpl_thread*thread)
- using zpl_async_cb = void(*)(void*data)
-
using zpl_thread = struct zpl_
thread -
using zpl_sync = struct zpl_
sync
Functions
-
auto __attribute__((aligned(4))) -> struct zpl_
atomic32 - __attribute__((aligned(8)))
- __attribute__((aligned(ZPL_ATOMIC_PTR_ALIGNMENT)))
-
auto zpl_mutex_init(zpl_
mutex* m) -> void -
auto zpl_mutex_destroy(zpl_
mutex* m) -> void -
auto zpl_mutex_lock(zpl_
mutex* m) -> void -
auto zpl_mutex_try_lock(zpl_
mutex* m) -> b32 -
auto zpl_mutex_unlock(zpl_
mutex* m) -> void -
auto zpl_thread_init(zpl_
thread* t) -> void -
auto zpl_thread_destroy(zpl_
thread* t) -> void -
auto zpl_thread_start(zpl_
thread* t, zpl_ thread_ proc proc, void* data) -> void -
auto zpl_thread_start_with_stack(zpl_
thread* t, zpl_ thread_ proc proc, void* data, isize stack_size) -> void -
auto zpl_thread_join(zpl_
thread* t) -> void -
auto zpl_thread_is_running(zpl_
thread const* t) -> b32 - auto zpl_thread_current_id(void) -> u32
-
auto zpl_thread_set_name(zpl_
thread* t, char const* name) -> void -
auto zpl_sync_init(zpl_
sync* s) -> void -
auto zpl_sync_destroy(zpl_
sync* s) -> void -
auto zpl_sync_set_target(zpl_
sync* s, i32 count) -> void -
auto zpl_sync_release(zpl_
sync* s) -> void -
auto zpl_sync_reach(zpl_
sync* s) -> i32 -
auto zpl_sync_reach_and_wait(zpl_
sync* s) -> void - auto zpl_affinity_init(zpl_affinity* a) -> void
- auto zpl_affinity_destroy(zpl_affinity* a) -> void
- auto zpl_affinity_set(zpl_affinity* a, isize core, isize thread) -> b32
- auto zpl_affinity_thread_count_for_core(zpl_affinity* a, isize core) -> isize
Variables
- typedef __attribute__
- zpl_mutex
Defines
- #define zpl_async(data, work, cb)