objc

thread.h
Go to the documentation of this file.
1 
36 #pragma once
37 #include <stdbool.h>
38 #include <stdint.h>
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
52 typedef void (*sys_thread_func_t)(void *arg);
53 
64 extern uint8_t sys_thread_numcores(void);
65 
80 bool sys_thread_create(sys_thread_func_t func, void *arg);
81 
96 bool sys_thread_create_on_core(sys_thread_func_t func, void *arg, uint8_t core);
97 
108 extern uint8_t sys_thread_core(void);
109 
115 extern void sys_sleep(int32_t msec);
116 
117 #ifdef __cplusplus
118 }
119 #endif
uint8_t sys_thread_numcores(void)
Returns the number of CPU cores available on the host system.
void sys_sleep(int32_t msec)
Pauses the execution of the current thread for a specified time.
bool sys_thread_create(sys_thread_func_t func, void *arg)
Create a thread on any available core.
void(* sys_thread_func_t)(void *arg)
Thread function signatureFunction signature for thread entry points.
Definition: thread.h:52
uint8_t sys_thread_core(void)
Get the CPU core number the current thread is running on.
bool sys_thread_create_on_core(sys_thread_func_t func, void *arg, uint8_t core)
Create a thread on a specific core.