summaryrefslogtreecommitdiff
path: root/sql/rpl_parallel.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-01-20 02:32:35 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-01-28 17:39:07 +0400
commit3503fbbebf90cb0fe63993a66dad9bf97fb74c0a (patch)
tree1c39a1f4d4d694a8b2d1166cae48050fe82b6c1c /sql/rpl_parallel.cc
parent891be49a36ebb951cd90d64d1b4c1cc633af1fdf (diff)
downloadmariadb-git-3503fbbebf90cb0fe63993a66dad9bf97fb74c0a.tar.gz
Move THD list handling to THD_list
Implemented and integrated THD_list as a replacement for the global thread list. It uses own mutex instead of LOCK_thread_count for THD list protection. Removed unused first_global_thread() and next_global_thread(). delayed_insert_threads is now protected by LOCK_delayed_insert. Although this patch doesn't fix very wrong synchronization of this variable. After this patch there are only 2 legitimate uses of LOCK_thread_count left, both in mysqld.cc: thread_count and ready_to_exit. Aim is to reduce usage of LOCK_thread_count and COND_thread_count. Part of MDEV-15135.
Diffstat (limited to 'sql/rpl_parallel.cc')
-rw-r--r--sql/rpl_parallel.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc
index 144b12a9fdf..dc5e3ff1fbf 100644
--- a/sql/rpl_parallel.cc
+++ b/sql/rpl_parallel.cc
@@ -1023,7 +1023,7 @@ handle_rpl_parallel_thread(void *arg)
my_thread_init();
thd = new THD(next_thread_id());
thd->thread_stack = (char*)&thd;
- add_to_active_threads(thd);
+ server_threads.insert(thd);
set_current_thd(thd);
pthread_detach_this_thread();
thd->init_for_queries();
@@ -1432,7 +1432,7 @@ handle_rpl_parallel_thread(void *arg)
thd->temporary_tables= 0;
THD_CHECK_SENTRY(thd);
- unlink_not_visible_thd(thd);
+ server_threads.erase(thd);
delete thd;
mysql_mutex_lock(&rpt->LOCK_rpl_thread);