Many POSIX blocking functions return EINTR in case of a signal. The idea is that signal handler sets a flag first (say 'stop' flag in case of SIGINT), then the blocking function unblocks returning EINTR and the application sees the flag and performs orderly shutdown (or whatever).
However, there is no EINTR error for some blocking functions like pthread_mutex_lock and pthread_cond_wait.
What's the idea behind that? How are the applications using these functions supposed to handle signals (Ctrl+C, specifically)?
No answer. My assumption is that pthread_cond_wait() and SIGINT cannot be combined to perform a clean shutdown. Use sem_wait() or similar instead of pthread_cond_wait().