6 static void *thread_fn(
void *arg)
10 return (
void *)(uintptr_t)thread->
fn(thread->
arg);
28 if (pthread_create(&thread->
impl, NULL, thread_fn, thread) != 0)
46 if (pthread_join(thread->
impl, &result) != 0)
58 return pthread_self();
#define STA_DECL
sal2 annotation on function implementations to copy annotations from the declaration
os_thread_id_t os_get_thread_id(void)
get the current thread id
unsigned os_status_t
thread return code
size_t os_thread_id_t
thread id
os_exitcode_t(* os_thread_fn_t)(void *arg)
#define CTASSERT(expr)
assert a condition, prints the condition as a message
STA_DECL os_error_t os_thread_join(os_thread_t *thread, os_status_t *status)
STA_DECL os_error_t os_thread_init(os_thread_t *thread, const char *name, os_thread_fn_t fn, void *arg)