summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 09e4953cdc4..4f025c7c335 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2041,9 +2041,9 @@ public:
thd.unlink(); // Must be unlinked under lock
my_free(thd.query());
thd.security_ctx->user= thd.security_ctx->host=0;
- thread_count--;
delayed_insert_threads--;
mysql_mutex_unlock(&LOCK_thread_count);
+ thread_safe_decrement32(&thread_count, &thread_count_lock);
mysql_cond_broadcast(&COND_thread_count); /* Tell main we are ready */
}
@@ -2178,9 +2178,9 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
{
if (!(di= new Delayed_insert()))
goto end_create;
- mysql_mutex_lock(&LOCK_thread_count);
- thread_count++;
- mysql_mutex_unlock(&LOCK_thread_count);
+
+ thread_safe_increment32(&thread_count, &thread_count_lock);
+
/*
Annotating delayed inserts is not supported.
*/
@@ -3891,8 +3891,8 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
{
if (!mysql_create_table_no_lock(thd, create_table->db,
create_table->table_name,
- create_info, alter_info, 0,
- select_field_count, NULL))
+ create_info, alter_info, NULL,
+ select_field_count))
{
DEBUG_SYNC(thd,"create_table_select_before_open");