fix error messages

This commit is contained in:
David Rose 2008-10-09 23:19:22 +00:00
parent a673b4367a
commit 2834641b49
3 changed files with 13 additions and 2 deletions

View File

@ -48,7 +48,12 @@ INLINE void ConditionVarPosixImpl::
wait() { wait() {
TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER); TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER);
int result = pthread_cond_wait(&_cvar, &_mutex._lock); int result = pthread_cond_wait(&_cvar, &_mutex._lock);
nassertv(result == 0); #ifndef NDEBUG
if (result != 0) {
pipeline_cat.error()
<< "Unexpected error " << result << " from pthread_cond_wait()\n";
}
#endif
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View File

@ -41,7 +41,12 @@ wait(double timeout) {
ts.tv_nsec += (int)((timeout - seconds) * 1000000.0); ts.tv_nsec += (int)((timeout - seconds) * 1000000.0);
int result = pthread_cond_timedwait(&_cvar, &_mutex._lock, &ts); int result = pthread_cond_timedwait(&_cvar, &_mutex._lock, &ts);
nassertv(result == 0 || errno == ETIMEDOUT); #ifndef NDEBUG
if (result != 0 && result != ETIMEDOUT) {
pipeline_cat.error()
<< "Unexpected error " << result << " from pthread_cond_timedwait()\n";
}
#endif
} }
#endif // HAVE_POSIX_THREADS #endif // HAVE_POSIX_THREADS

View File

@ -22,6 +22,7 @@
#include "mutexPosixImpl.h" #include "mutexPosixImpl.h"
#include "pnotify.h" #include "pnotify.h"
#include "config_pipeline.h"
#include <pthread.h> #include <pthread.h>