1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

cleanup: thread_count

move thread_count handling into THD:
* increment thread_count in THD constructor
* decrement thread_count in THD destructor
* never modify thread_count directly!
This commit is contained in:
Sergei Golubchik
2016-05-14 13:22:47 +02:00
parent 7425610c81
commit 562c1df7d9
14 changed files with 22 additions and 68 deletions

View File

@ -1906,6 +1906,20 @@ private:
inline bool is_conventional() const
{ DBUG_ASSERT(0); return Statement::is_conventional(); }
void dec_thread_count(void)
{
DBUG_ASSERT(thread_count > 0);
thread_safe_decrement32(const_cast<int32*>(&thread_count));
signal_thd_deleted();
}
void inc_thread_count(void)
{
thread_safe_increment32(const_cast<int32*>(&thread_count));
DBUG_ASSERT(!abort_loop);
}
public:
MDL_context mdl_context;