make pthread_mutex_unlock include the reason for why the unlock fails.

This commit is contained in:
Bernhard Amann 2012-07-11 20:10:49 -07:00
parent b31ef8cde5
commit 8ff8c66655

View file

@ -116,8 +116,9 @@ void BasicThread::Stop()
// Signal that it's ok for the thread to exit now by unlocking the
// mutex.
if ( pthread_mutex_unlock(&terminate) != 0 )
reporter->FatalError("Failure flagging terminate condition for thread %s", name.c_str());
int err = pthread_mutex_unlock(&terminate);
if ( err != 0 )
reporter->FatalError("Failure flagging terminate condition for thread %s: %s", name.c_str(), strerror(err));
terminating = true;