91 void *(*thread_func)(
void *);
160 const char *thread_name);
🔌 Cross-platform abstraction layer umbrella header for ascii-chat
asciichat_error_t
Error and exit codes - unified status values (0-255)
Thread pool entry (internal linked list node)
void * thread_arg
Thread argument.
asciichat_thread_t thread
Thread handle.
struct thread_pool_entry * next
Linked list next pointer.
int stop_id
Cleanup order (lower = stop first, -1 = unordered)
char name[64]
Thread name for debugging.
mutex_t threads_mutex
Mutex protecting thread list.
thread_pool_entry_t * threads
Linked list of threads (sorted by stop_id)
size_t thread_count
Number of threads in pool.
char name[64]
Pool name for debugging.
void thread_pool_destroy(thread_pool_t *pool)
Destroy a thread pool.
thread_pool_t * thread_pool_create(const char *pool_name)
Create a new thread pool.
size_t thread_pool_get_count(const thread_pool_t *pool)
Get thread count in the pool.
bool thread_pool_has_threads(const thread_pool_t *pool)
Check if pool has any threads.
asciichat_error_t thread_pool_spawn(thread_pool_t *pool, void *(*thread_func)(void *), void *thread_arg, int stop_id, const char *thread_name)
Spawn a worker thread in the pool.
asciichat_error_t thread_pool_stop_all(thread_pool_t *pool)
Stop all threads in the pool in stop_id order.
Common SIMD utilities and structures.