summaryrefslogtreecommitdiff
path: root/libmysqld/lib_sql.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2013-10-13 23:25:57 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2013-10-13 23:25:57 +0500
commite37639e9349b56296d452e69e970df939383d7e1 (patch)
tree38e53f8f56203d1224132a29d65b794af022bb16 /libmysqld/lib_sql.cc
parent508d40fbdbe02c390f102d991ce0675f519784dd (diff)
downloadmariadb-git-e37639e9349b56296d452e69e970df939383d7e1.tar.gz
MDEV-5131 create_embedded_thd is not thread safe, libmysqld.
LOCK_thread_count locked when we do threads.append().
Diffstat (limited to 'libmysqld/lib_sql.cc')
-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 88f8f039ce2..d5e5ecca2f5 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -683,8 +683,10 @@ void *create_embedded_thd(int client_flag)
thd->data_tail= &thd->first_data;
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;
return thd;
err: