소스 검색

fix error messages

David Rose 17 년 전
부모
커밋
2834641b49
3개의 변경된 파일13개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 1
      panda/src/pipeline/conditionVarPosixImpl.I
  2. 6 1
      panda/src/pipeline/conditionVarPosixImpl.cxx
  3. 1 0
      panda/src/pipeline/conditionVarPosixImpl.h

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

@@ -48,7 +48,12 @@ INLINE void ConditionVarPosixImpl::
 wait() {
   TAU_PROFILE("ConditionVarPosixImpl::wait()", " ", TAU_USER);
   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);
 
   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

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

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