server/thpool.c
/* Wait until all jobs have finished */
Wait until all jobs have finished
Wait until all jobs have finished
void thpool_wait(thpool_ *thpool_p) {
    pthread_mutex_lock(&thpool_p->thcount_lock);
    while (thpool_p->jobqueue.len || thpool_p->num_threads_working) {
        pthread_cond_wait(&thpool_p->threads_all_idle, &thpool_p->thcount_lock);
    }
    pthread_mutex_unlock(&thpool_p->thcount_lock);
}
void thpool_wait ( thpool_ * thpool_p ) { pthread_mutex_lock ( & thpool_p -> thcount_lock ) ; while ( thpool_p -> jobqueue . len || thpool_p -> num_threads_working ) { pthread_cond_wait ( & thpool_p -> threads_all_idle , & thpool_p -> thcount_lock ) ; } pthread_mutex_unlock ( & thpool_p -> thcount_lock ) ; }
Wait until all jobs have finished
Wait until all jobs have finished