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

Cleaned up output from thr_print_locks

parent 4040a17e
...@@ -1684,12 +1684,15 @@ void thr_print_locks(void) ...@@ -1684,12 +1684,15 @@ 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);
if ((lock->write.data || lock->read.data ||
lock->write_wait.data || lock->read_wait.data))
{
printf("lock: 0x%lx:",(ulong) lock); printf("lock: 0x%lx:",(ulong) lock);
if ((lock->write_wait.data || lock->read_wait.data) && if ((lock->write_wait.data || lock->read_wait.data) &&
(! lock->read.data && ! lock->write.data)) (! lock->read.data && ! lock->write.data))
...@@ -1707,9 +1710,10 @@ void thr_print_locks(void) ...@@ -1707,9 +1710,10 @@ void thr_print_locks(void)
thr_print_lock("write_wait",&lock->write_wait); thr_print_lock("write_wait",&lock->write_wait);
thr_print_lock("read",&lock->read); thr_print_lock("read",&lock->read);
thr_print_lock("read_wait",&lock->read_wait); thr_print_lock("read_wait",&lock->read_wait);
mysql_mutex_unlock(&lock->mutex);
puts(""); puts("");
} }
mysql_mutex_unlock(&lock->mutex);
}
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