소스 검색

rename SIMPLE_THREADS_NO_IMPLICIT_YIELD

David Rose 17 년 전
부모
커밋
75b5e032f0
3개의 변경된 파일30개의 추가작업 그리고 3개의 파일을 삭제
  1. 28 1
      panda/src/pgraph/renderAttrib.cxx
  2. 1 1
      panda/src/pipeline/mutexTrueImpl.h
  3. 1 1
      panda/src/putil/copyOnWritePointer.h

+ 28 - 1
panda/src/pgraph/renderAttrib.cxx

@@ -426,7 +426,34 @@ release_new() {
   nassertv(_attribs_lock->debug_is_locked());
   nassertv(_attribs_lock->debug_is_locked());
 
 
   if (_saved_entry != _attribs->end()) {
   if (_saved_entry != _attribs->end()) {
-    nassertv(_attribs->find(this) == _saved_entry);
+
+#ifndef NDEBUG
+    nassertd(_attribs->find(this) == _saved_entry) {
+      cerr << "Tried to release " << *this << " (" << (void *)this << "), not found!\n";
+      Attribs::const_iterator si = _attribs->begin();
+      if (si == _attribs->end()) {
+        cerr << "  Attribs list is empty.\n";
+      } else {
+        cerr << "  Attribs list contains " << _attribs->size() << " entries.\n";
+        const RenderAttrib *attrib = (*si);
+        cerr << "    " << *attrib << " (" << (void *)attrib << ")\n";
+
+        Attribs::const_iterator sprev = si;
+        ++si;
+        while (si != _attribs->end()) {
+          const RenderAttrib *attrib = (*si);
+          cerr << "    " << *attrib << " (" << (void *)attrib << ")\n";
+          if (!((*sprev) < (*si))) {
+            cerr << "*** out of order!\n";
+          }
+          sprev = si;
+          ++si;
+        }
+        cerr << "  Done.\n";
+      }
+    }
+#endif  // NDEBUG
+
     _attribs->erase(_saved_entry);
     _attribs->erase(_saved_entry);
     _saved_entry = _attribs->end();
     _saved_entry = _attribs->end();
   }
   }

+ 1 - 1
panda/src/pipeline/mutexTrueImpl.h

@@ -33,7 +33,7 @@
 // until we have defined the whole ThreadSimpleManager and related
 // until we have defined the whole ThreadSimpleManager and related
 // infrastructure.
 // infrastructure.
 
 
-#if defined(THREAD_SIMPLE_IMPL) && !defined(SIMPLE_THREADS_NO_IMPLICIT_YIELD)
+#if defined(THREAD_SIMPLE_IMPL) && !defined(SIMPLE_THREADS_NO_MUTEX)
 
 
 #include "mutexSimpleImpl.h"
 #include "mutexSimpleImpl.h"
 #include "reMutexSimpleImpl.h"
 #include "reMutexSimpleImpl.h"

+ 1 - 1
panda/src/putil/copyOnWritePointer.h

@@ -24,7 +24,7 @@
 // Should we implement full thread protection for CopyOnWritePointer?
 // Should we implement full thread protection for CopyOnWritePointer?
 // If we can be assured that no other thread will interrupt while a
 // If we can be assured that no other thread will interrupt while a
 // write pointer is held, we don't need thread protection.
 // write pointer is held, we don't need thread protection.
-#if defined(HAVE_THREADS) && !(defined(SIMPLE_THREADS) && defined(SIMPLE_THREADS_NO_IMPLICIT_YIELD))
+#if defined(HAVE_THREADS) && !(defined(SIMPLE_THREADS) && defined(SIMPLE_THREADS_NO_MUTEX))
   #define COW_THREADED 1
   #define COW_THREADED 1
 #else
 #else
   #undef COW_THREADED
   #undef COW_THREADED