diff options
author | Eugene Kosov <claprix@yandex.ru> | 2020-04-30 20:06:26 +0300 |
---|---|---|
committer | Eugene Kosov <claprix@yandex.ru> | 2020-05-05 18:13:31 +0300 |
commit | 89ff4176c125f5993aba0732e52102227577ed96 (patch) | |
tree | 42980e30d3f4f02b09b0fda80790f7241fd699f4 /plugin | |
parent | 90aad47dd9f28101b1d2c4a01c2a10db5ad5f426 (diff) | |
download | mariadb-git-89ff4176c125f5993aba0732e52102227577ed96.tar.gz |
MDEV-22437 make THR_THD* variable thread_local
Now all access goes through _current_thd() and set_current_thd()
functions.
Some functions like THD::store_globals() can not fail now.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/feedback/sender_thread.cc | 3 | ||||
-rw-r--r-- | plugin/handler_socket/handlersocket/database.cpp | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc index 36db4e44cc0..fd9ab65c0fa 100644 --- a/plugin/feedback/sender_thread.cc +++ b/plugin/feedback/sender_thread.cc @@ -92,8 +92,7 @@ static int prepare_for_fill(TABLE_LIST *tables) thd->variables.pseudo_thread_id= thd->thread_id; server_threads.insert(thd); thd->thread_stack= (char*) &tables; - if (thd->store_globals()) - return 1; + thd->store_globals(); thd->mysys_var->current_cond= &sleep_condition; thd->mysys_var->current_mutex= &sleep_mutex; diff --git a/plugin/handler_socket/handlersocket/database.cpp b/plugin/handler_socket/handlersocket/database.cpp index 001981e3baa..91b095cb655 100644 --- a/plugin/handler_socket/handlersocket/database.cpp +++ b/plugin/handler_socket/handlersocket/database.cpp @@ -302,7 +302,7 @@ dbcontext::init_thread(const void *stack_bottom, volatile int& shutdown_flag) thd->db.length= sizeof("handlersocket")-1; } thd->variables.option_bits |= OPTION_TABLE_LOCK; - my_pthread_setspecific_ptr(THR_THD, thd); + set_current_thd(thd); DBG_THR(fprintf(stderr, "HNDSOCK x0 %p\n", thd)); } { @@ -339,7 +339,7 @@ dbcontext::term_thread() { DBG_THR(fprintf(stderr, "HNDSOCK thread end %p\n", thd)); close_tables_if(); - my_pthread_setspecific_ptr(THR_THD, 0); + set_current_thd(nullptr); { delete thd; thd = 0; |