diff options
author | Monty <monty@mariadb.org> | 2017-06-09 10:04:00 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-24 01:04:34 +0200 |
commit | 44676ed5b115c84a8e2023f51ffd38e6240461db (patch) | |
tree | e311a2613fa542c0fc24a86d4ecc74c638d9d190 /mysys | |
parent | 4040a17ea2d727225e5e9765d7cb044d88c305d9 (diff) | |
download | mariadb-git-44676ed5b115c84a8e2023f51ffd38e6240461db.tar.gz |
Cleaned up output from thr_print_locks
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/thr_lock.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 98a1fa784a4..6cb9d6af13d 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -1684,31 +1684,35 @@ void thr_print_locks(void) uint count=0; mysql_mutex_lock(&THR_LOCK_lock); - puts("Current locks:"); + puts("Current active THR (table level locks):"); for (list= thr_lock_thread_list; list && count++ < MAX_THREADS; list= list_rest(list)) { THR_LOCK *lock=(THR_LOCK*) list->data; mysql_mutex_lock(&lock->mutex); - printf("lock: 0x%lx:",(ulong) lock); - if ((lock->write_wait.data || lock->read_wait.data) && - (! lock->read.data && ! lock->write.data)) - printf(" WARNING: "); - if (lock->write.data) - printf(" write"); - if (lock->write_wait.data) - printf(" write_wait"); - if (lock->read.data) - printf(" read"); - if (lock->read_wait.data) - printf(" read_wait"); - puts(""); - thr_print_lock("write",&lock->write); - thr_print_lock("write_wait",&lock->write_wait); - thr_print_lock("read",&lock->read); - thr_print_lock("read_wait",&lock->read_wait); + if ((lock->write.data || lock->read.data || + lock->write_wait.data || lock->read_wait.data)) + { + printf("lock: 0x%lx:",(ulong) lock); + if ((lock->write_wait.data || lock->read_wait.data) && + (! lock->read.data && ! lock->write.data)) + printf(" WARNING: "); + if (lock->write.data) + printf(" write"); + if (lock->write_wait.data) + printf(" write_wait"); + if (lock->read.data) + printf(" read"); + if (lock->read_wait.data) + printf(" read_wait"); + puts(""); + thr_print_lock("write",&lock->write); + thr_print_lock("write_wait",&lock->write_wait); + thr_print_lock("read",&lock->read); + thr_print_lock("read_wait",&lock->read_wait); + puts(""); + } mysql_mutex_unlock(&lock->mutex); - puts(""); } fflush(stdout); mysql_mutex_unlock(&THR_LOCK_lock); |