From 54b61b8b44eb0ff5257bbac8b38578c4c5f2ed38 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 29 Dec 2011 01:59:05 +0100 Subject: LP9091416: destroy timer mutex when threadpool scheduler shuts down. Fixes valgrind warning. --- sql/threadpool_unix.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sql/threadpool_unix.cc') diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index 6d0ab80ad78..d421870fcab 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -470,7 +470,10 @@ static void* timer_thread(void *param) mysql_mutex_lock(&timer->mutex); int err = mysql_cond_timedwait(&timer->cond, &timer->mutex, &ts); if (timer->shutdown) + { + mysql_mutex_unlock(&timer->mutex); break; + } if (err == ETIMEDOUT) { timer->current_microtime= microsecond_interval_timer(); @@ -488,6 +491,8 @@ static void* timer_thread(void *param) } mysql_mutex_unlock(&timer->mutex); } + + mysql_mutex_destroy(&timer->mutex); DBUG_POP(); my_thread_end(); return NULL; -- cgit v1.2.1