Sometimes, etherape crashes when exiting. My
understanding is that mutex condition is destroyed from
thread 1 while pthread_cond_wait() is still executing
on thread 2. My fix is to move close_mutex() call from
thread_close() to the end of thread_pool_routine().
That way, the condition variable can not go away while
pthread library is using it. Patch attached.
I hope I haven't misunderstood pthreads, I'm really a
newbie in this area.