indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and
creates new one. If pthread_mutex_destroy() fails because the mutex is
locked, the new mutex is not created -> the old one is used, but it's already
locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function
interruptible when waiting for events, e.g. using a pipe and select(),
this pthread_cancel leads to memory leaks.
|