Jelajahi Sumber

fix double-lock detection

David Rose 18 tahun lalu
induk
melakukan
2719a277e5
1 mengubah file dengan 3 tambahan dan 4 penghapusan
  1. 3 4
      panda/src/pipeline/mutexDebug.cxx

+ 3 - 4
panda/src/pipeline/mutexDebug.cxx

@@ -91,13 +91,12 @@ do_lock() {
   } else if (_locking_thread == this_thread) {
   } else if (_locking_thread == this_thread) {
     // The mutex is already locked by this thread.  Increment the lock
     // The mutex is already locked by this thread.  Increment the lock
     // count.
     // count.
-    nassertv(_lock_count >= 0);
-    if (!_allow_recursion && _lock_count == 0) {
+    nassertv(_lock_count > 0);
+    if (!_allow_recursion) {
       ostringstream ostr;
       ostringstream ostr;
-      ostr << *_locking_thread << " attempted to re-lock non-reentrant "
+      ostr << *_locking_thread << " attempted to double-lock non-reentrant "
            << *this;
            << *this;
       nassert_raise(ostr.str());
       nassert_raise(ostr.str());
-      return;
     }
     }
     ++_lock_count;
     ++_lock_count;