From 75b5e032f0239068a483141484dafa0e9e876b4a Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 11 Sep 2008 01:37:12 +0000 Subject: [PATCH] rename SIMPLE_THREADS_NO_IMPLICIT_YIELD --- panda/src/pgraph/renderAttrib.cxx | 29 +++++++++++++++++++++++++++- panda/src/pipeline/mutexTrueImpl.h | 2 +- panda/src/putil/copyOnWritePointer.h | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraph/renderAttrib.cxx b/panda/src/pgraph/renderAttrib.cxx index 5ecae028d0..88752c8bc9 100644 --- a/panda/src/pgraph/renderAttrib.cxx +++ b/panda/src/pgraph/renderAttrib.cxx @@ -426,7 +426,34 @@ release_new() { nassertv(_attribs_lock->debug_is_locked()); 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); _saved_entry = _attribs->end(); } diff --git a/panda/src/pipeline/mutexTrueImpl.h b/panda/src/pipeline/mutexTrueImpl.h index 135efdf041..24d2dbee44 100644 --- a/panda/src/pipeline/mutexTrueImpl.h +++ b/panda/src/pipeline/mutexTrueImpl.h @@ -33,7 +33,7 @@ // until we have defined the whole ThreadSimpleManager and related // 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 "reMutexSimpleImpl.h" diff --git a/panda/src/putil/copyOnWritePointer.h b/panda/src/putil/copyOnWritePointer.h index 7c51d49455..dc8963ecd7 100644 --- a/panda/src/putil/copyOnWritePointer.h +++ b/panda/src/putil/copyOnWritePointer.h @@ -24,7 +24,7 @@ // Should we implement full thread protection for CopyOnWritePointer? // If we can be assured that no other thread will interrupt while a // 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 #else #undef COW_THREADED