Go to the documentation of this file.
7 #include "../../include/sync/wait_group.h"
15 pthread_mutex_init(&wg->
mutex, NULL);
17 pthread_cond_init(&wg->
cond_var, NULL);
41 pthread_cond_init(&wg->
cond_var, NULL);
59 pthread_mutex_lock(&wg->
mutex);
60 pthread_mutex_destroy(&wg->
mutex);
65 pthread_mutex_lock(&wg->
mutex);
67 pthread_mutex_unlock(&wg->
mutex);
73 pthread_mutex_lock(&wg->
mutex);
78 printf(
"[warn] invalid call to wait_group_done with 0 active processes\n");
84 pthread_mutex_unlock(&wg->
mutex);
void wait_group_send_signal(wait_group_t *wg)
pthread_mutex_t cond_mutex
int wait_group_done(wait_group_t *wg)
used by a process to indicate it is done, decreasing the active process counter we include a return c...
void wait_group_recv_signal(wait_group_t *wg)
void wait_group_reset_signal(wait_group_t *wg)
void wait_group_wait(wait_group_t *wg)
used to wait until current active_processes reaches 0, polling every 0.75 seconds will run free on th...
void wait_group_add(wait_group_t *wg, int count)
incremements the total number of active processes managed by this wait group
wait_group_t * wait_group_new()
returns a new and initialized wait_group_t pointer