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:
Mark Michelson
2008-05-12 17:51:14 +00:00
parent f0efe0d2b5
commit f1696e2133

View File

@@ -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)