diff --git a/src/threading/BasicThread.cc b/src/threading/BasicThread.cc index e5a4dc5dbe..3dda6b5e8c 100644 --- a/src/threading/BasicThread.cc +++ b/src/threading/BasicThread.cc @@ -86,12 +86,12 @@ void BasicThread::Start() int err = pthread_mutex_init(&terminate, 0); if ( err != 0 ) - reporter->FatalError("Cannot create terminate mutex for thread %s:%s", name.c_str(), strerror(err)); + reporter->FatalError("Cannot create terminate mutex for thread %s: %s", name.c_str(), strerror(err)); // We use this like a binary semaphore and acquire it immediately. err = pthread_mutex_lock(&terminate); if ( err != 0 ) - reporter->FatalError("Cannot aquire terminate mutex for thread %s:%s", name.c_str(), strerror(err)); + reporter->FatalError("Cannot aquire terminate mutex for thread %s: %s", name.c_str(), strerror(err)); err = pthread_create(&pthread, 0, BasicThread::launcher, this); if ( err != 0 ) @@ -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;