Browse Source

fix error messages

David Rose 17 years ago
parent
commit
2834641b49

+ 6 - 1
panda/src/pipeline/conditionVarPosixImpl.I

@@ -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
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 6 - 1
panda/src/pipeline/conditionVarPosixImpl.cxx

@@ -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

+ 1 - 0
panda/src/pipeline/conditionVarPosixImpl.h

@@ -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>