24 #define THREAD_CALL_CONV
25 typedef void *thrd_ret_t;
26 typedef pthread_t thr_id_t;
28 #define THREAD_RET_FAILURE ((void *)1)
29 #define THREAD_RET_SUCCESS ((void *)0)
31 #elif defined(__WINDOWS)
33 #define WIN32_LEAN_AND_MEAN
35 #undef WIN32_LEAN_AND_MEAN
37 #define THREAD_CALL_CONV WINAPI
38 typedef DWORD thrd_ret_t;
39 typedef HANDLE thr_id_t;
41 #define THREAD_RET_FAILURE (1)
42 #define THREAD_RET_SUCCESS (0)
thrd_ret_t(THREAD_CALL_CONV * thr_run_fnc)(void *)
The function type of a new thread entry point.
Definition: thread.h:46
int thread_wait(thr_id_t thr, thrd_ret_t *ret)
Wait for specified thread to complete execution.
int thread_affinity_set(thr_id_t thr, unsigned core)
Sets a core affinity for a thread.
unsigned thread_cores_count(void)
Computes the count of available cores on the machine.
int thread_start(thr_id_t *thr_p, thr_run_fnc t_fnc, void *t_fnc_arg)
Creates a thread.