mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
If a thread holds no locks, do not print any information on the thread when issuing
a core show locks command. This will help to de-clutter output somewhat. Russell said it would be fine to place this improvement in the 1.4 branch, so that's why it's going here too. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -736,6 +736,7 @@ static int handle_show_locks(int fd, int argc, char *argv[])
|
||||
pthread_mutex_lock(&lock_infos_lock.mutex);
|
||||
AST_LIST_TRAVERSE(&lock_infos, lock_info, entry) {
|
||||
int i;
|
||||
if (lock_info->num_locks) {
|
||||
ast_dynamic_str_append(&str, 0, "=== Thread ID: %u (%s)\n", (int) lock_info->thread_id,
|
||||
lock_info->thread_name);
|
||||
pthread_mutex_lock(&lock_info->lock);
|
||||
@@ -777,6 +778,7 @@ static int handle_show_locks(int fd, int argc, char *argv[])
|
||||
if (!str)
|
||||
break;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&lock_infos_lock.mutex);
|
||||
|
||||
if (!str)
|
||||
|
Reference in New Issue
Block a user