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:
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user