Removed redundant service_thread_count

In contrast to thread_count, which is decremented by THD destructor,
this one was most probably intended to be decremented after all THD
destructors are done.

THD_count class was added to achieve similar effect with thread_count.

Aim is to reduce usage of LOCK_thread_count and COND_thread_count.
Part of MDEV-15135.
This commit is contained in:
Sergey Vojtovich 2019-01-22 22:45:26 +04:00
commit 9824ec81aa
7 changed files with 49 additions and 65 deletions

View file

@ -205,7 +205,6 @@ void Ack_receiver::run()
thd->thread_stack= (char*) &thd;
thd->store_globals();
thd->security_ctx->skip_grants();
thread_safe_increment32(&service_thread_count);
thd->set_command(COM_DAEMON);
init_net(&net, net_buff, REPLY_MESSAGE_MAX_LENGTH);
@ -284,8 +283,6 @@ end:
sql_print_information("Stopping ack receiver thread");
m_status= ST_DOWN;
delete thd;
thread_safe_decrement32(&service_thread_count);
signal_thd_deleted();
mysql_cond_broadcast(&m_cond);
mysql_mutex_unlock(&m_mutex);
DBUG_VOID_RETURN;