1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Avoid taking LOCK_thread_count for thread_count protection

Replaced wait on COND_thread_count with busy waiting with 1 millisecond
sleep.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
This commit is contained in:
Sergey Vojtovich
2019-01-29 01:13:47 +04:00
parent 8553525931
commit 4b3656a44d
4 changed files with 7 additions and 34 deletions

View File

@ -2152,14 +2152,11 @@ struct THD_count
*/
~THD_count()
{
uint32_t t= thread_count--;
#ifndef DBUG_OFF
uint32_t t=
#endif
thread_count--;
DBUG_ASSERT(t > 0);
if (t == 1)
{
mysql_mutex_lock(&LOCK_thread_count);
mysql_cond_broadcast(&COND_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
}
}
};