Commit e37639e9 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-5131 create_embedded_thd is not thread safe, libmysqld.

        LOCK_thread_count locked when we do threads.append().
parent 508d40fb
...@@ -683,8 +683,10 @@ void *create_embedded_thd(int client_flag) ...@@ -683,8 +683,10 @@ void *create_embedded_thd(int client_flag)
thd->data_tail= &thd->first_data; thd->data_tail= &thd->first_data;
bzero((char*) &thd->net, sizeof(thd->net)); bzero((char*) &thd->net, sizeof(thd->net));
mysql_mutex_lock(&LOCK_thread_count);
thread_count++; thread_count++;
threads.append(thd); threads.append(thd);
mysql_mutex_unlock(&LOCK_thread_count);
thd->mysys_var= 0; thd->mysys_var= 0;
return thd; return thd;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment