Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
sem_post(&redact);
sem_post(&mutex);
}
sem_post(&redact);
sem_post(&mutex);
}
}
static void *redacteur(void *arg)
}
static void *redacteur(void *arg)
sleep(2);
sem_post(&redact);
}
sleep(2);
sem_post(&redact);
}
static void* fonction(void* args) {
printf("pid du thread fils = %d\n", getpid());
static void* fonction(void* args) {
printf("pid du thread fils = %d\n", getpid());
printf("pid de main = %d\n", getpid());
pthread_create(&thread, NULL, &fonction, NULL);
printf("pid de main = %d\n", getpid());
pthread_create(&thread, NULL, &fonction, NULL);