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.
This commit is contained in:
Eugene Kosov 2020-04-30 20:06:26 +03:00
commit 89ff4176c1
23 changed files with 56 additions and 121 deletions

View file

@ -128,11 +128,12 @@ bool
post_init_event_thread(THD *thd)
{
(void) init_new_connection_handler_thread();
if (init_thr_lock() || thd->store_globals())
if (init_thr_lock())
{
thd->cleanup();
return TRUE;
}
thd->store_globals();
return FALSE;
}