diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-05-14 13:22:47 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-06-04 09:06:00 +0200 |
commit | 562c1df7d97cb23145e09b3482fd18d49476752d (patch) | |
tree | 0d8e3d45c78dafd5854e8c6d6488b232f3f631a7 /libmysqld/lib_sql.cc | |
parent | 7425610c81ca1329d72a97f57770e5b052d08079 (diff) | |
download | mariadb-git-562c1df7d97cb23145e09b3482fd18d49476752d.tar.gz |
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!
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r-- | libmysqld/lib_sql.cc | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 7855a5f2a73..8ce11ebff0e 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -426,7 +426,6 @@ static void emb_free_embedded_thd(MYSQL *mysql) THD *thd= (THD*)mysql->thd; mysql_mutex_lock(&LOCK_thread_count); thd->clear_data_list(); - thread_count--; thd->store_globals(); thd->unlink(); mysql_mutex_unlock(&LOCK_thread_count); @@ -700,7 +699,6 @@ void *create_embedded_thd(int client_flag) bzero((char*) &thd->net, sizeof(thd->net)); mysql_mutex_lock(&LOCK_thread_count); - thread_count++; threads.append(thd); mysql_mutex_unlock(&LOCK_thread_count); thd->mysys_var= 0; |