mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix double-lock detection
This commit is contained in:
parent
ad6e2116cc
commit
2719a277e5
@ -91,13 +91,12 @@ do_lock() {
|
||||
} else if (_locking_thread == this_thread) {
|
||||
// The mutex is already locked by this thread. Increment the lock
|
||||
// count.
|
||||
nassertv(_lock_count >= 0);
|
||||
if (!_allow_recursion && _lock_count == 0) {
|
||||
nassertv(_lock_count > 0);
|
||||
if (!_allow_recursion) {
|
||||
ostringstream ostr;
|
||||
ostr << *_locking_thread << " attempted to re-lock non-reentrant "
|
||||
ostr << *_locking_thread << " attempted to double-lock non-reentrant "
|
||||
<< *this;
|
||||
nassert_raise(ostr.str());
|
||||
return;
|
||||
}
|
||||
++_lock_count;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user