server/thpool.c
/* Init semaphore to 1 or 0 */
Init semaphore to 1 or 0
Init semaphore to 1 or 0
static void bsem_init(bsem *bsem_p, int value) {
    if (value < 0 || value > 1) {
        err("bsem_init(): Binary semaphore can take only values 1 or 0");
        exit(1);
    }
    pthread_mutex_init(&(bsem_p->mutex), NULL);
    pthread_cond_init(&(bsem_p->cond), NULL);
    bsem_p->v = value;
}
static void bsem_init ( bsem * bsem_p , int value ) { if ( value < 0 || value > 1 ) { err ( " " ) ; exit ( 1 ) ; } pthread_mutex_init ( & ( bsem_p -> mutex ) , NULL ) ; pthread_cond_init ( & ( bsem_p -> cond ) , NULL ) ; bsem_p -> v = value ; }
Init semaphore to 1 or 0
Init semaphore to 1 or 0