diff options
Diffstat (limited to 'include/tinyff/common.h')
| -rw-r--r-- | include/tinyff/common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/tinyff/common.h b/include/tinyff/common.h index 2b17911..6d93a70 100644 --- a/include/tinyff/common.h +++ b/include/tinyff/common.h @@ -8,6 +8,10 @@ #include <stddef.h> #include <tinyff/stream.h> +#ifdef USE_THREAD +#include <pthread.h> +#endif + #ifdef USE_BENCH #include <tinyff/bench/bench.h> @@ -128,6 +132,11 @@ typedef struct ff_ctx { #ifdef USE_BENCH ff_bench bench; #endif + + #ifdef USE_THREAD + /* mutex to protect ctx internal mutable state when threads are enabled */ + pthread_mutex_t ff_lock; + #endif } ff_ctx; ff_ctx* ff_init(ff_allocator* allocator); |
