void *producer() {
    sem_wait(&empty);
    sem_wait(&mutex);
    produce();
    sem_post(&mutex);
    sem_post(&fill);
    cut_hair(); 
}void *consumer() {
    sem_wait(&fill);
    sem_wait(&mutex);
    consume();
    sem_post(&mutex);
    sem_post(&empty);
}