mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Less shared variables loads under the mutex
Part of MDEV-19515 - Improve connect speed
This commit is contained in:
parent
8268fa881f
commit
218a68bbc5
1 changed files with 7 additions and 7 deletions
|
@ -2688,10 +2688,15 @@ static bool cache_thread(THD *thd)
|
||||||
_db_pop_();
|
_db_pop_();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (! wake_thread && ! kill_cached_threads)
|
while (!wake_thread)
|
||||||
{
|
{
|
||||||
int error= mysql_cond_timedwait(&COND_thread_cache, &LOCK_thread_cache,
|
int error= mysql_cond_timedwait(&COND_thread_cache, &LOCK_thread_cache,
|
||||||
&abstime);
|
&abstime);
|
||||||
|
if (kill_cached_threads)
|
||||||
|
{
|
||||||
|
mysql_cond_signal(&COND_flush_thread_cache);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (error == ETIMEDOUT || error == ETIME)
|
if (error == ETIMEDOUT || error == ETIME)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -2703,14 +2708,9 @@ static bool cache_thread(THD *thd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cached_thread_count--;
|
cached_thread_count--;
|
||||||
if (kill_cached_threads)
|
if (auto connect= thread_cache.get())
|
||||||
mysql_cond_signal(&COND_flush_thread_cache);
|
|
||||||
if (wake_thread)
|
|
||||||
{
|
{
|
||||||
CONNECT *connect;
|
|
||||||
|
|
||||||
wake_thread--;
|
wake_thread--;
|
||||||
connect= thread_cache.get();
|
|
||||||
mysql_mutex_unlock(&LOCK_thread_cache);
|
mysql_mutex_unlock(&LOCK_thread_cache);
|
||||||
|
|
||||||
if (!(connect->create_thd(thd)))
|
if (!(connect->create_thd(thd)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue