[insight-vmi] r1998 committed - Fixed deadlock when parsing the source code with multiple threads.

0 views
Skip to first unread message

insig...@googlecode.com

unread,
Jun 26, 2013, 5:15:08 AM6/26/13
to insight-v...@googlegroups.com
Revision: 1998
Author: chrsc...@googlemail.com
Date: Wed Jun 26 02:14:57 2013
Log: Fixed deadlock when parsing the source code with multiple threads.

http://code.google.com/p/insight-vmi/source/detail?r=1998

Modified:
/trunk/libinsight/referencingtype.cpp

=======================================
--- /trunk/libinsight/referencingtype.cpp Mon Feb 4 07:44:15 2013
+++ /trunk/libinsight/referencingtype.cpp Wed Jun 26 02:14:57 2013
@@ -83,7 +83,10 @@
}
// Cache the value
if (!ref->_refTypeDeep || resolveTypes != ref->_deepResolvedTypes) {
- ref->_deepResolvedTypes = resolveTypes;
+ // Calling refType() might lead to recurisve locks, so release the
+ // lock for now
+ ref->_deepResolveMutex.unlock();
+
base_t* t = ref->refType();
if ( t && (t->type() & resolveTypes & RefBaseTypes) ) {
ref_base_t* rbt = static_cast<ref_base_t*>(t);
@@ -91,6 +94,9 @@
rbt = static_cast<ref_base_t*>(t = rbt->refType());
}
}
+ // Lock the mutex again before applying the result
+ ref->_deepResolveMutex.lock();
+ ref->_deepResolvedTypes = resolveTypes;
ref->_refTypeDeep = const_cast<BaseType*>(t);
}

Reply all
Reply to author
Forward
0 new messages