summaryrefslogtreecommitdiff
path: root/main/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/lock.c')
-rw-r--r--main/lock.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/main/lock.c b/main/lock.c
index 902d63119..3036e5bc4 100644
--- a/main/lock.c
+++ b/main/lock.c
@@ -29,6 +29,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/utils.h"
#include "asterisk/lock.h"
/* Allow direct use of pthread_mutex_* / pthread_cond_* */
@@ -45,6 +46,22 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#undef pthread_cond_wait
#undef pthread_cond_timedwait
+#if defined(DEBUG_THREADS) && defined(HAVE_BKTR)
+static void __dump_backtrace(struct ast_bt *bt, int canlog)
+{
+ char **strings;
+ ssize_t i;
+
+ strings = backtrace_symbols(bt->addresses, bt->num_frames);
+
+ for (i = 0; i < bt->num_frames; i++) {
+ __ast_mutex_logger("%s\n", strings[i]);
+ }
+
+ ast_std_free(strings);
+}
+#endif /* defined(DEBUG_THREADS) && defined(HAVE_BKTR) */
+
int __ast_pthread_mutex_init(int tracking, const char *filename, int lineno, const char *func,
const char *mutex_name, ast_mutex_t *t)
{