Commit 54b61b8b authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

LP9091416: destroy timer mutex when threadpool scheduler shuts down.

Fixes valgrind warning.
parent ecad00bc
...@@ -470,7 +470,10 @@ static void* timer_thread(void *param) ...@@ -470,7 +470,10 @@ static void* timer_thread(void *param)
mysql_mutex_lock(&timer->mutex); mysql_mutex_lock(&timer->mutex);
int err = mysql_cond_timedwait(&timer->cond, &timer->mutex, &ts); int err = mysql_cond_timedwait(&timer->cond, &timer->mutex, &ts);
if (timer->shutdown) if (timer->shutdown)
{
mysql_mutex_unlock(&timer->mutex);
break; break;
}
if (err == ETIMEDOUT) if (err == ETIMEDOUT)
{ {
timer->current_microtime= microsecond_interval_timer(); timer->current_microtime= microsecond_interval_timer();
...@@ -488,6 +491,8 @@ static void* timer_thread(void *param) ...@@ -488,6 +491,8 @@ static void* timer_thread(void *param)
} }
mysql_mutex_unlock(&timer->mutex); mysql_mutex_unlock(&timer->mutex);
} }
mysql_mutex_destroy(&timer->mutex);
DBUG_POP(); DBUG_POP();
my_thread_end(); my_thread_end();
return NULL; return NULL;
......
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