summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-10-14 13:39:18 -0700
committerIgor Babaev <igor@askmonty.org>2013-10-14 13:39:18 -0700
commiteb2c6f451392396ef2ca74f1dba761fc4459d171 (patch)
tree4b9e6c400215cd74a81c65b1fa8a0200ea7249c3 /libmysqld
parentddc46740a56bf3885ae33dc21e281c063d189abf (diff)
parenteae0a45f4e5ed4f1e382e53be74dd8082d4d797a (diff)
downloadmariadb-git-eb2c6f451392396ef2ca74f1dba761fc4459d171.tar.gz
Merge 5.5->10.0-base
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 0809e91d134..bd36520e9f2 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -416,11 +416,13 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
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();
delete thd;
+ mysql_mutex_unlock(&LOCK_thread_count);
my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
}