diff options
Diffstat (limited to 'src/tpool.h')
-rw-r--r-- | src/tpool.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tpool.h b/src/tpool.h new file mode 100644 index 0000000..04f0486 --- /dev/null +++ b/src/tpool.h @@ -0,0 +1,19 @@ +#ifndef GRAB_TPOOL_H +#define GRAB_TPOOL_H + +#include <pthread.h> +#include <stdatomic.h> +#include <stddef.h> + +typedef struct { + int tcnt; + pthread_t *thrds; + atomic_ptrdiff_t wi; + const char **files; + ptrdiff_t filecnt; +} tpool_t; + +int tpinit(tpool_t *tp, const char **files, ptrdiff_t filecnt); +void tpfree(tpool_t *tp); + +#endif /* !GRAB_TPOOL_H */ |