[asterisk-commits] mjordan: branch mjordan/trunk-deadlock r376126 - in /team/mjordan/trunk-deadl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 9 21:28:23 CST 2012


Author: mjordan
Date: Fri Nov  9 21:28:20 2012
New Revision: 376126

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376126
Log:
Did our thread ID get changed out from under us?

Modified:
    team/mjordan/trunk-deadlock/include/asterisk/lock.h
    team/mjordan/trunk-deadlock/main/lock.c

Modified: team/mjordan/trunk-deadlock/include/asterisk/lock.h
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-deadlock/include/asterisk/lock.h?view=diff&rev=376126&r1=376125&r2=376126
==============================================================================
--- team/mjordan/trunk-deadlock/include/asterisk/lock.h (original)
+++ team/mjordan/trunk-deadlock/include/asterisk/lock.h Fri Nov  9 21:28:20 2012
@@ -125,7 +125,9 @@
 	unsigned int tracking:1;
 };
 
+#ifdef DEBUG_THREADS
 static pthread_mutex_t reentrancy_lock = PTHREAD_MUTEX_INIT_VALUE;
+#endif
 
 /*! \brief Structure for rwlock and tracking information.
  *

Modified: team/mjordan/trunk-deadlock/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/trunk-deadlock/main/lock.c?view=diff&rev=376126&r1=376125&r2=376126
==============================================================================
--- team/mjordan/trunk-deadlock/main/lock.c (original)
+++ team/mjordan/trunk-deadlock/main/lock.c Fri Nov  9 21:28:20 2012
@@ -1008,8 +1008,14 @@
 		if (lt->reentrancy != AST_MAX_REENTRANCY) {
 			ast_bt_get_addresses(&lt->backtrace[lt->reentrancy]);
 			bt = &lt->backtrace[lt->reentrancy];
+			lt->file[lt->reentrancy] = filename;
+			lt->lineno[lt->reentrancy] = lineno;
+			lt->func[lt->reentrancy] = func;
+			lt->thread[lt->reentrancy] = pthread_self();
 		}
 		if (ast_reentrancy_unlock(lt)) {
+			fprintf(stderr, "Original thread ID %ld\n", lt->thread[lt->reentrancy]);
+			fprintf(stderr, "Current thread ID %ld\n", pthread_self());
 			__dump_backtrace(&lt->backtrace[lt->reentrancy], 0);
 			abort();
 		}




More information about the asterisk-commits mailing list