I got a couple threads which pass data to each other and process them a little. Once I put synchronization between the last two threads the program started crashing. I don't have much experience with threads so instead of debugging i just commented the whole content of the last thread so it's just running while cycle, the other thread remains the same except for the synchronization part which is just
pthread_mutex_lock(&mutex);
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
and which i then also commented which made the app work without crash.
There is absolutely nothing dependent on the mutex or the conditional variable in the rest of the program. It also works if I only comment the pthread_cond_signal(&cond);. Any ideas on what is going on?