[asterisk-commits] mjordan: branch mjordan/1.8_instrumented r362534 - /team/mjordan/1.8_instrume...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 19 09:08:06 CDT 2012
Author: mjordan
Date: Thu Apr 19 09:08:00 2012
New Revision: 362534
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362534
Log:
Add a lot of prints around the reentrancy lock
Modified:
team/mjordan/1.8_instrumented/main/lock.c
Modified: team/mjordan/1.8_instrumented/main/lock.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/1.8_instrumented/main/lock.c?view=diff&rev=362534&r1=362533&r2=362534
==============================================================================
--- team/mjordan/1.8_instrumented/main/lock.c (original)
+++ team/mjordan/1.8_instrumented/main/lock.c Thu Apr 19 09:08:00 2012
@@ -117,11 +117,13 @@
filename, lineno, func, mutex_name);
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
__ast_mutex_logger("%s line %d (%s): Error: '%s' was locked here.\n",
lt->file[ROFFSET], lt->lineno[ROFFSET], lt->func[ROFFSET], mutex_name);
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
}
break;
@@ -137,6 +139,7 @@
}
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
lt->file[0] = filename;
lt->lineno[0] = lineno;
lt->func[0] = func;
@@ -145,6 +148,7 @@
#ifdef HAVE_BKTR
memset(<->backtrace[0], 0, sizeof(lt->backtrace[0]));
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
delete_reentrancy_cs(&t->track);
}
@@ -188,10 +192,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
#else
@@ -218,6 +224,7 @@
__ast_mutex_logger("%s line %d (%s): Deadlock? waited %d sec for mutex '%s'?\n",
filename, lineno, func, (int) wait_time, mutex_name);
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[lt->reentrancy], canlog);
#endif
@@ -227,6 +234,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
reported_wait = wait_time;
}
@@ -247,6 +255,7 @@
#ifdef DEBUG_THREADS
if (t->tracking && !res) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = lineno;
@@ -257,6 +266,7 @@
__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
filename, lineno, func, mutex_name);
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -265,7 +275,9 @@
#ifdef HAVE_BKTR
if (lt->reentrancy) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
bt = <->backtrace[lt->reentrancy-1];
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
} else {
bt = NULL;
@@ -278,6 +290,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error obtaining mutex: %s\n",
filename, lineno, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -320,10 +333,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_MUTEX, filename, lineno, func, mutex_name, t, bt);
#else
@@ -337,6 +352,7 @@
#ifdef DEBUG_THREADS
if (t->tracking && !res) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = lineno;
@@ -347,6 +363,7 @@
__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
filename, lineno, func, mutex_name);
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -391,6 +408,7 @@
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
filename, lineno, func, mutex_name);
@@ -399,6 +417,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
}
@@ -420,6 +439,7 @@
bt = <->backtrace[lt->reentrancy - 1];
}
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -436,6 +456,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error releasing mutex: %s\n",
filename, lineno, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -501,6 +522,7 @@
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
filename, lineno, func, mutex_name);
@@ -509,6 +531,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
}
@@ -530,6 +553,7 @@
bt = <->backtrace[lt->reentrancy - 1];
}
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -546,9 +570,11 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
filename, lineno, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
} else if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = lineno;
@@ -563,6 +589,7 @@
__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
filename, lineno, func, mutex_name);
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -609,6 +636,7 @@
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy && (lt->thread[ROFFSET] != pthread_self())) {
__ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
filename, lineno, func, mutex_name);
@@ -617,6 +645,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[ROFFSET], canlog);
#endif
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
}
@@ -637,6 +666,7 @@
bt = <->backtrace[lt->reentrancy - 1];
}
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -653,9 +683,11 @@
if (res && (res != ETIMEDOUT)) {
__ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
filename, lineno, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, lineno, func);
DO_THREAD_CRASH;
} else if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = lineno;
@@ -670,6 +702,7 @@
__ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
filename, lineno, func, mutex_name);
}
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -743,6 +776,7 @@
}
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, lineno, func, __LINE__);
lt->file[0] = filename;
lt->lineno[0] = lineno;
lt->func[0] = func;
@@ -751,6 +785,7 @@
#ifdef HAVE_BKTR
memset(<->backtrace[0], 0, sizeof(lt->backtrace[0]));
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, lineno, func);
ast_reentrancy_unlock(lt);
delete_reentrancy_cs(&t->track);
}
@@ -792,6 +827,7 @@
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy) {
int i;
pthread_t self = pthread_self();
@@ -821,7 +857,7 @@
filename, line, func, name);
lt->reentrancy = 0;
}
-
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
#ifdef HAVE_BKTR
@@ -838,6 +874,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error releasing rwlock: %s\n",
filename, line, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, line, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -879,10 +916,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
#else
@@ -904,6 +943,7 @@
filename, line, func, (int)wait_time, name);
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[lt->reentrancy], canlog);
#endif
@@ -913,6 +953,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[lt->reentrancy-1], canlog);
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
}
reported_wait = wait_time;
@@ -928,6 +969,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -935,6 +977,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -943,7 +986,9 @@
#ifdef HAVE_BKTR
if (lt->reentrancy) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
bt = <->backtrace[lt->reentrancy-1];
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
} else {
bt = NULL;
@@ -957,6 +1002,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
filename, line, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, line, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -998,10 +1044,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
@@ -1023,6 +1071,7 @@
filename, line, func, (int)wait_time, name);
if (t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[lt->reentrancy], canlog);
#endif
@@ -1032,6 +1081,7 @@
#ifdef HAVE_BKTR
__dump_backtrace(<->backtrace[lt->reentrancy-1], canlog);
#endif
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
}
reported_wait = wait_time;
@@ -1047,6 +1097,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -1054,6 +1105,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -1062,7 +1114,9 @@
#ifdef HAVE_BKTR
if (lt->reentrancy) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
bt = <->backtrace[lt->reentrancy-1];
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
} else {
bt = NULL;
@@ -1079,6 +1133,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error obtaining write lock: %s\n",
filename, line, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, line, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -1121,10 +1176,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
@@ -1154,6 +1211,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -1161,6 +1219,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -1169,7 +1228,9 @@
#ifdef HAVE_BKTR
if (lt->reentrancy) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
bt = <->backtrace[lt->reentrancy-1];
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
} else {
bt = NULL;
@@ -1182,6 +1243,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
filename, line, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, line, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -1224,10 +1286,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
@@ -1257,6 +1321,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -1264,6 +1329,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -1272,7 +1338,9 @@
#ifdef HAVE_BKTR
if (lt->reentrancy) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
bt = <->backtrace[lt->reentrancy-1];
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
} else {
bt = NULL;
@@ -1289,6 +1357,7 @@
if (res) {
__ast_mutex_logger("%s line %d (%s): Error obtaining read lock: %s\n",
filename, line, func, strerror(res));
+ printf("Crashing thread %s line %d (%s)\n", filename, line, func);
DO_THREAD_CRASH;
}
#endif /* DEBUG_THREADS */
@@ -1330,10 +1399,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_RDLOCK, filename, line, func, name, t, bt);
#else
@@ -1347,6 +1418,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -1354,6 +1426,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
if (t->tracking) {
ast_mark_lock_acquired(t);
@@ -1400,10 +1473,12 @@
if (t->tracking) {
#ifdef HAVE_BKTR
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy != AST_MAX_REENTRANCY) {
ast_bt_get_addresses(<->backtrace[lt->reentrancy]);
bt = <->backtrace[lt->reentrancy];
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_store_lock_info(AST_WRLOCK, filename, line, func, name, t, bt);
#else
@@ -1417,6 +1492,7 @@
#ifdef DEBUG_THREADS
if (!res && t->tracking) {
ast_reentrancy_lock(lt);
+ printf("Global lock obtained by %s line %d (%s) at %d\n", filename, line, func, __LINE__);
if (lt->reentrancy < AST_MAX_REENTRANCY) {
lt->file[lt->reentrancy] = filename;
lt->lineno[lt->reentrancy] = line;
@@ -1424,6 +1500,7 @@
lt->thread[lt->reentrancy] = pthread_self();
lt->reentrancy++;
}
+ printf("Global lock released by %s line %d (%s)\n", filename, line, func);
ast_reentrancy_unlock(lt);
ast_mark_lock_acquired(t);
} else if (t->tracking) {
More information about the asterisk-commits
mailing list