aboutsummaryrefslogtreecommitdiff
path: root/tpool.h
blob: e1079efd4456a0a77fda975c2dfda0165f63b997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdbool.h>
#include <stdlib.h>

#ifndef __TPOOL_H
#define __TPOOL_H
 
struct tpool;
typedef struct tpool tpool_t;

extern tpool_t *tpool;

typedef void (*thread_func_t)(void *arg);

tpool_t *tpool_create(size_t num);
void tpool_destroy(tpool_t *tp);

bool tpool_add_work(tpool_t *tp, thread_func_t func, void *arg);
void tpool_wait(tpool_t *tp);

#endif