Skip to content
Snippets Groups Projects
Commit b4574d2a authored by Brett Bryant's avatar Brett Bryant
Browse files

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
parent 122486b2
Branches
Tags
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment