11 #include <semaphore.h>
ghost_error ghost_thpool_destroy()
Destroy the thread pool.
Definition: thpool.c:72
ghost_error ghost_thpool_get(ghost_thpool **thpool)
Get the thread pool.
Definition: thpool.c:102
ghost_error ghost_thpoolhread_add(void *(func)(void *), intptr_t arg)
Definition: thpool.c:58
pthread_t * threads
The pthread to thread.
Definition: thpool.h:25
Types, functions and macros for error handling.
ghost_error
Error return type.
Definition: error.h:23
static ghost_thpool * thpool
The thread pool created by ghost_thpool_create().
Definition: thpool.c:15
ghost_error ghost_thpool_create(int nThreads, void *(*func)(void *))
Creates or resizes a thread pool.
int nThreads
The total number of threads in the thread pool.
Definition: thpool.h:29
sem_t * sem
Counts the number of initialized threads.
Definition: thpool.h:36
struct ghost_thpool ghost_thpool
The thread pool consisting of all shepherd threads that will ever handle a GHOST task.
The thread pool consisting of all shepherd threads that will ever handle a GHOST task.
Definition: thpool.h:19
ghost_error ghost_thpool_key(pthread_key_t *key)
Definition: thpool.c:112