diff options
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r-- | sql/threadpool_common.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 98b2dcd1fcd..e5ac4b49a2a 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -13,7 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ -#include <my_global.h> +#include "mariadb.h" #include <violite.h> #include <sql_priv.h> #include <sql_class.h> @@ -84,17 +84,13 @@ struct Worker_thread_context void save() { -#ifdef HAVE_PSI_THREAD_INTERFACE - psi_thread = PSI_THREAD_CALL(get_thread)(); -#endif + psi_thread = PSI_CALL_get_thread(); mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys); } void restore() { -#ifdef HAVE_PSI_THREAD_INTERFACE - PSI_THREAD_CALL(set_thread)(psi_thread); -#endif + PSI_CALL_set_thread(psi_thread); pthread_setspecific(THR_KEY_mysys,mysys_var); pthread_setspecific(THR_THD, 0); } @@ -144,9 +140,7 @@ static void thread_attach(THD* thd) pthread_setspecific(THR_KEY_mysys,thd->mysys_var); thd->thread_stack=(char*)&thd; thd->store_globals(); -#ifdef HAVE_PSI_THREAD_INTERFACE - PSI_THREAD_CALL(set_thread)(thd->event_scheduler.m_psi); -#endif + PSI_CALL_set_thread(thd->event_scheduler.m_psi); mysql_socket_set_thread_owner(thd->net.vio->mysql_socket); } @@ -199,7 +193,7 @@ void tp_callback(TP_connection *c) c->priority= get_priority(c); /* Read next command from client. */ - c->set_io_timeout(thd->variables.net_wait_timeout); + c->set_io_timeout(thd->get_net_wait_timeout()); c->state= TP_STATE_IDLE; if (c->start_io()) goto error; @@ -254,10 +248,8 @@ static THD* threadpool_add_connection(CONNECT *connect, void *scheduler_data) thd->event_scheduler.data= scheduler_data; /* Create new PSI thread for use with the THD. */ -#ifdef HAVE_PSI_THREAD_INTERFACE thd->event_scheduler.m_psi= - PSI_THREAD_CALL(new_thread)(key_thread_one_connection, thd, thd->thread_id); -#endif + PSI_CALL_new_thread(key_thread_one_connection, thd, thd->thread_id); /* Login. */ |