From c7ab12bba64d9c20ccd79b132dac475f7bc3923e Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Wed, 21 Jan 2026 22:22:16 +0100 Subject: Re-enable multi-threading --- tpool.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tpool.h (limited to 'tpool.h') diff --git a/tpool.h b/tpool.h new file mode 100644 index 0000000..d03f70a --- /dev/null +++ b/tpool.h @@ -0,0 +1,21 @@ +#ifndef THREAD_POOL_H +#define THREAD_POOL_H + +#include +#include + +typedef void (*thread_func_t)(void *arg); + +typedef struct { + thread_func_t function; + void *arg; +} ThreadPoolJob; + +typedef struct ThreadPool ThreadPool; + +ThreadPool *tp_create(int num_threads); +void tp_add_job(ThreadPool *pool, thread_func_t function, void *arg); +void tp_wait(ThreadPool *pool); +void tp_destroy(ThreadPool *pool); + +#endif -- cgit v1.2.3