Index: include/asterisk/lock.h =================================================================== --- include/asterisk/lock.h (revision 107227) +++ include/asterisk/lock.h (working copy) @@ -299,6 +299,10 @@ const char* mutex_name, ast_mutex_t *t) { int res; + + if (!(t)->track) + t->track = 1; + int canlog = strcmp(filename, "logger.c") & t->track; #if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) @@ -354,7 +358,8 @@ ast_mark(mtx_prof, 0); if (res) #endif - res = pthread_mutex_lock(&t->mutex); + if (&t->mutex) + res = pthread_mutex_lock(&t->mutex); #endif /* DETECT_DEADLOCKS */ if (!res) {