summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-06 14:25:20 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-06 14:25:20 +0300
commit780d2bb8a7eca4fdbdf70fbd51c0bdbae5b0057e (patch)
treeb7447115f45de0f03bbe18c26fc0866367483066 /sql/wsrep_mysqld.cc
parentdb9e41ddc31f2e705a54132cf69c781e1cc60f07 (diff)
parent18af13b88ba580562981a190c25da128a2e9db26 (diff)
downloadmariadb-git-780d2bb8a7eca4fdbdf70fbd51c0bdbae5b0057e.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index ad4203490f2..22b274bef1b 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2251,6 +2251,7 @@ static void wsrep_close_thread(THD *thd)
{
thd->set_killed(KILL_CONNECTION);
MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (thd));
+ mysql_mutex_lock(&thd->LOCK_thd_kill);
if (thd->mysys_var)
{
thd->mysys_var->abort=1;
@@ -2263,6 +2264,7 @@ static void wsrep_close_thread(THD *thd)
}
mysql_mutex_unlock(&thd->mysys_var->mutex);
}
+ mysql_mutex_unlock(&thd->LOCK_thd_kill);
}
static my_bool have_committing_connections(THD *thd, void *)
@@ -2659,7 +2661,8 @@ void* start_wsrep_THD(void *arg)
/* now that we've called my_thread_init(), it is safe to call DBUG_* */
thd->thread_stack= (char*) &thd;
- if (thd->store_globals())
+ wsrep_assign_from_threadvars(thd);
+ if (wsrep_store_threadvars(thd))
{
close_connection(thd, ER_OUT_OF_RESOURCES);
statistic_increment(aborted_connects,&LOCK_status);
@@ -2697,19 +2700,17 @@ void* start_wsrep_THD(void *arg)
WSREP_DEBUG("wsrep system thread %llu, %p starting",
thd->thread_id, thd);
- thd_args->fun()(thd, thd_args->args());
+ thd_args->fun()(thd, static_cast<void *>(thd_args));
WSREP_DEBUG("wsrep system thread: %llu, %p closing",
thd->thread_id, thd);
/* Wsrep may reset globals during thread context switches, store globals
before cleanup. */
- thd->store_globals();
+ wsrep_store_threadvars(thd);
close_connection(thd, 0);
- delete thd_args;
-
mysql_mutex_lock(&LOCK_wsrep_slave_threads);
DBUG_ASSERT(wsrep_running_threads > 0);
wsrep_running_threads--;
@@ -2728,6 +2729,7 @@ void* start_wsrep_THD(void *arg)
break;
}
+ delete thd_args;
WSREP_DEBUG("wsrep running threads now: %lu", wsrep_running_threads);
mysql_cond_broadcast(&COND_wsrep_slave_threads);
mysql_mutex_unlock(&LOCK_wsrep_slave_threads);