From: Brett Bryant Date: Thu, 19 Jun 2008 19:48:26 +0000 (+0000) Subject: Add errors that report any locks held by threads when they are being closed. X-Git-Tag: 1.6.2.0-beta1~1937 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4574d2a79929eb84d085c0f0ee17c9cf4759505;p=thirdparty%2Fasterisk.git Add errors that report any locks held by threads when they are being closed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@124064 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/utils.c b/main/utils.c index b043b6149a..4b9869984c 100644 --- a/main/utils.c +++ b/main/utils.c @@ -574,11 +574,25 @@ static AST_LIST_HEAD_NOLOCK_STATIC(lock_infos, thr_lock_info); static void lock_info_destroy(void *data) { struct thr_lock_info *lock_info = data; + int i; pthread_mutex_lock(&lock_infos_lock.mutex); AST_LIST_REMOVE(&lock_infos, lock_info, entry); pthread_mutex_unlock(&lock_infos_lock.mutex); + + for (i = 0; i < lock_info->num_locks; i++) { + ast_log(LOG_ERROR, + "Thread '%s' still has a lock! - '%s' (%p) from '%s' in %s:%d!\n", + lock_info->thread_name, + lock_info->locks[i].lock_name, + lock_info->locks[i].lock_addr, + lock_info->locks[i].func, + lock_info->locks[i].file, + lock_info->locks[i].line_num + ); + } + pthread_mutex_destroy(&lock_info->lock); if (lock_info->thread_name) free((void *) lock_info->thread_name);