picofuse

thread.h
Go to the documentation of this file.
1 
40 #pragma once
41 
42 #include <stdbool.h>
43 #include <stdint.h>
44 
51 #ifndef SYS_THREAD_CAPACITY
52 #define SYS_THREAD_CAPACITY 16
53 #endif
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
60 // TYPES
61 
70 typedef void (*sys_thread_func_t)(void *arg);
71 
73 // PUBLIC METHODS
74 
88 uint8_t sys_thread_numcores(void);
89 
105 bool sys_thread_create(sys_thread_func_t func, void *arg);
106 
123 bool sys_thread_create_on_core(sys_thread_func_t func, void *arg, uint8_t core);
124 
135 uint8_t sys_thread_core(void);
136 
139 #ifdef __cplusplus
140 }
141 #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:70
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.