From edc34e77d5f19aa2a697f16d9e2d24677dafb506 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Mon, 8 Jun 2026 10:35:16 +1000 Subject: feat(thread): Implement pthread bridge and fix allocator usage in wrapper --- include/bridges/pthread/thread_bridge.h | 13 +++++++++++++ include/tinyff/thread/thread.h | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 include/bridges/pthread/thread_bridge.h (limited to 'include') diff --git a/include/bridges/pthread/thread_bridge.h b/include/bridges/pthread/thread_bridge.h new file mode 100644 index 0000000..dc7b75b --- /dev/null +++ b/include/bridges/pthread/thread_bridge.h @@ -0,0 +1,13 @@ +#ifdef USE_THREAD + +#ifndef BRIDGES_PTHREAD_THREAD_BRIDGE_H +#define BRIDGES_PTHREAD_THREAD_BRIDGE_H + +#include +#include + +pthread_t run_job_in_thread(ff_thread_job *job); + +#endif + +#endif \ No newline at end of file diff --git a/include/tinyff/thread/thread.h b/include/tinyff/thread/thread.h index 40c09a0..1d0a644 100644 --- a/include/tinyff/thread/thread.h +++ b/include/tinyff/thread/thread.h @@ -3,15 +3,17 @@ #ifndef TINYFF_THREAD_H #define TINYFF_THREAD_H +#include + typedef void (*ff_job_cb)(void *arg); typedef struct { ff_job_cb callback; void *arg; + ff_ctx *ctx; } ff_thread_job; void *ff_thread_wrapper(void *ptr); -// Each platform must have their own bridge for running a thread job -// Like pthreads for POSIX systems #endif +#endif \ No newline at end of file -- cgit v1.2.3