diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-19 19:49:54 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-19 19:49:54 +0000 |
commit | 7821fc22bc22868dacce2d6a775093384f194991 (patch) | |
tree | 77030e9b6173eb2bd49a7161d5403f8dd80acc6e /main | |
parent | 34c985761dd7dc27cca7a8ad2a705d9b712e6f1f (diff) |
Merged revisions 124064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r124064 | bbryant | 2008-06-19 14:48:26 -0500 (Thu, 19 Jun 2008) | 2 lines
Add errors that report any locks held by threads when they are being closed.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@124065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/utils.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c index c14d4c4b0..668df5066 100644 --- a/main/utils.c +++ b/main/utils.c @@ -568,11 +568,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); |