1#ifndef THREAD_POOL_H
2#define THREAD_POOL_H
3
4#include <pthread.h>
5#include <stdbool.h>
6
7typedef void (*thread_func_t)(void *arg);
8
9typedef struct {
10 thread_func_t function;
11 void *arg;
12} ThreadPoolJob;
13
14typedef struct ThreadPool ThreadPool;
15
16ThreadPool *tp_create(int num_threads);
17void tp_add_job(ThreadPool *pool, thread_func_t function, void *arg);
18void tp_wait(ThreadPool *pool);
19void tp_destroy(ThreadPool *pool);
20
21#endif