Commit 44676ed5 authored by Monty's avatar Monty Committed by Sergei Golubchik

Cleaned up output from thr_print_locks

parent 4040a17e
...@@ -1684,31 +1684,35 @@ void thr_print_locks(void) ...@@ -1684,31 +1684,35 @@ void thr_print_locks(void)
uint count=0; uint count=0;
mysql_mutex_lock(&THR_LOCK_lock); 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; for (list= thr_lock_thread_list; list && count++ < MAX_THREADS;
list= list_rest(list)) list= list_rest(list))
{ {
THR_LOCK *lock=(THR_LOCK*) list->data; THR_LOCK *lock=(THR_LOCK*) list->data;
mysql_mutex_lock(&lock->mutex); mysql_mutex_lock(&lock->mutex);
printf("lock: 0x%lx:",(ulong) lock); if ((lock->write.data || lock->read.data ||
if ((lock->write_wait.data || lock->read_wait.data) && lock->write_wait.data || lock->read_wait.data))
(! lock->read.data && ! lock->write.data)) {
printf(" WARNING: "); printf("lock: 0x%lx:",(ulong) lock);
if (lock->write.data) if ((lock->write_wait.data || lock->read_wait.data) &&
printf(" write"); (! lock->read.data && ! lock->write.data))
if (lock->write_wait.data) printf(" WARNING: ");
printf(" write_wait"); if (lock->write.data)
if (lock->read.data) printf(" write");
printf(" read"); if (lock->write_wait.data)
if (lock->read_wait.data) printf(" write_wait");
printf(" read_wait"); if (lock->read.data)
puts(""); printf(" read");
thr_print_lock("write",&lock->write); if (lock->read_wait.data)
thr_print_lock("write_wait",&lock->write_wait); printf(" read_wait");
thr_print_lock("read",&lock->read); puts("");
thr_print_lock("read_wait",&lock->read_wait); 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); mysql_mutex_unlock(&lock->mutex);
puts("");
} }
fflush(stdout); fflush(stdout);
mysql_mutex_unlock(&THR_LOCK_lock); mysql_mutex_unlock(&THR_LOCK_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment