diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-18 16:46:57 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-18 16:46:57 +0200 |
commit | 5f6380adde2dac3f32b40339b9b702c0135eb7d6 (patch) | |
tree | 31068acc0b39c208d35d524688a5985831af0447 /sql/threadpool_common.cc | |
parent | 8a23ae088dc38f591efeab9eccdef5eb9094add9 (diff) | |
parent | 97e640b9ae83e07b444fceede6b0524256c7a3cc (diff) | |
download | mariadb-git-5f6380adde2dac3f32b40339b9b702c0135eb7d6.tar.gz |
10.0-base merge
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r-- | sql/threadpool_common.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 147a59df9b7..5be06f0bdc8 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -72,14 +72,18 @@ struct Worker_thread_context void save() { +#ifdef HAVE_PSI_INTERFACE psi_thread= PSI_server?PSI_server->get_thread():0; +#endif mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys); } void restore() { +#ifdef HAVE_PSI_INTERFACE if (PSI_server) PSI_server->set_thread(psi_thread); +#endif pthread_setspecific(THR_KEY_mysys,mysys_var); pthread_setspecific(THR_THD, 0); pthread_setspecific(THR_MALLOC, 0); @@ -95,8 +99,10 @@ static bool thread_attach(THD* thd) pthread_setspecific(THR_KEY_mysys,thd->mysys_var); thd->thread_stack=(char*)&thd; thd->store_globals(); +#ifdef HAVE_PSI_INTERFACE if (PSI_server) PSI_server->set_thread(thd->event_scheduler.m_psi); +#endif return 0; } @@ -123,11 +129,13 @@ int threadpool_add_connection(THD *thd) } /* Create new PSI thread for use with the THD. */ +#ifdef HAVE_PSI_INTERFACE if (PSI_server) { thd->event_scheduler.m_psi = PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id); } +#endif /* Login. */ |