This program created some threads, do a work, and when stopping calls
this function:
int i;
pthread_mutex_lock(&appStopMutex);
/* Send information to all the threads: */
applicationStopping = 1;
pthread_mutex_unlock(&appStopMutex);
/* Wait for all the threads to finish: */
for (i = 0; i < startedThreadsCount; i++) {
pthread_join(startedThreads[i], NULL);
--> This blocks in the last thread
}
Do anyone has an idea why this happens?
Thanks,
Eduardo