picofuse

thread.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <stdbool.h>
34 #include <stdint.h>
35 
42 #ifndef SYS_THREAD_CAPACITY
43 #define SYS_THREAD_CAPACITY 16
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
51 // TYPES
52 
61 typedef void (*sys_thread_func_t)(void *arg);
62 
64 // PUBLIC METHODS
65 
79 uint8_t sys_thread_numcores(void);
80 
96 bool sys_thread_create(sys_thread_func_t func, void *arg);
97 
114 bool sys_thread_create_on_core(sys_thread_func_t func, void *arg, uint8_t core);
115 
126 uint8_t sys_thread_core(void);
127 
130 #ifdef __cplusplus
131 }
132 #endif
uint8_t sys_thread_numcores(void)
Returns the number of CPU cores available on the host system.
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:61
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.