Merge lp:~sergei.glushchenko/percona-server/5.5-ps-bug1196383 into lp:percona-server/5.5

Proposed by Sergei Glushchenko on 2013-08-12
Status: Merged
Approved by: Laurynas Biveinis on 2013-10-01
Approved revision: 545
Merged at revision: 581
Proposed branch: lp:~sergei.glushchenko/percona-server/5.5-ps-bug1196383
Merge into: lp:percona-server/5.5
Diff against target: 80 lines (+13/-1)
2 files modified
Percona-Server/sql/threadpool_common.cc (+9/-1)
Percona-Server/sql/threadpool_unix.cc (+4/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/5.5-ps-bug1196383
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve on 2013-10-01
George Ormond Lorch III g2 2013-08-12 Approve on 2013-09-16
Review via email: mp+179667@code.launchpad.net

Description of the change

To post a comment you must log in.
review: Approve (g2)
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/sql/threadpool_common.cc'
--- Percona-Server/sql/threadpool_common.cc 2013-04-03 10:26:31 +0000
+++ Percona-Server/sql/threadpool_common.cc 2013-08-12 11:21:56 +0000
@@ -75,14 +75,18 @@
7575
76 void save()76 void save()
77 {77 {
78 psi_thread= PSI_server?PSI_server->get_thread():0;78#ifdef HAVE_PSI_INTERFACE
79 psi_thread= PSI_server ? PSI_server->get_thread() : 0;
80#endif
79 mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);81 mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);
80 }82 }
8183
82 void restore()84 void restore()
83 {85 {
86#ifdef HAVE_PSI_INTERFACE
84 if (PSI_server)87 if (PSI_server)
85 PSI_server->set_thread(psi_thread);88 PSI_server->set_thread(psi_thread);
89#endif
86 pthread_setspecific(THR_KEY_mysys,mysys_var);90 pthread_setspecific(THR_KEY_mysys,mysys_var);
87 pthread_setspecific(THR_THD, 0);91 pthread_setspecific(THR_THD, 0);
88 pthread_setspecific(THR_MALLOC, 0);92 pthread_setspecific(THR_MALLOC, 0);
@@ -98,8 +102,10 @@
98 pthread_setspecific(THR_KEY_mysys,thd->mysys_var);102 pthread_setspecific(THR_KEY_mysys,thd->mysys_var);
99 thd->thread_stack=(char*)&thd;103 thd->thread_stack=(char*)&thd;
100 thd->store_globals();104 thd->store_globals();
105#ifdef HAVE_PSI_INTERFACE
101 if (PSI_server)106 if (PSI_server)
102 PSI_server->set_thread(thd->event_scheduler.m_psi);107 PSI_server->set_thread(thd->event_scheduler.m_psi);
108#endif
103 return 0;109 return 0;
104}110}
105111
@@ -126,11 +132,13 @@
126 }132 }
127133
128 /* Create new PSI thread for use with the THD. */134 /* Create new PSI thread for use with the THD. */
135#ifdef HAVE_PSI_INTERFACE
129 if (PSI_server)136 if (PSI_server)
130 {137 {
131 thd->event_scheduler.m_psi = 138 thd->event_scheduler.m_psi =
132 PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);139 PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);
133 }140 }
141#endif
134142
135143
136 /* Login. */144 /* Login. */
137145
=== modified file 'Percona-Server/sql/threadpool_unix.cc'
--- Percona-Server/sql/threadpool_unix.cc 2013-04-03 10:26:31 +0000
+++ Percona-Server/sql/threadpool_unix.cc 2013-08-12 11:21:56 +0000
@@ -53,6 +53,7 @@
53*/53*/
54 54
55 55
56#ifdef HAVE_PSI_INTERFACE
56static PSI_mutex_key key_group_mutex;57static PSI_mutex_key key_group_mutex;
57static PSI_mutex_key key_timer_mutex;58static PSI_mutex_key key_timer_mutex;
58static PSI_mutex_info mutex_list[]=59static PSI_mutex_info mutex_list[]=
@@ -80,6 +81,7 @@
80/* Macro to simplify performance schema registration */ 81/* Macro to simplify performance schema registration */
81#define PSI_register(X) \82#define PSI_register(X) \
82 if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))83 if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
84#endif
8385
8486
85struct thread_group_t;87struct thread_group_t;
@@ -1546,9 +1548,11 @@
1546 sql_print_error("Can't set threadpool size to %d",threadpool_size);1548 sql_print_error("Can't set threadpool size to %d",threadpool_size);
1547 DBUG_RETURN(1);1549 DBUG_RETURN(1);
1548 }1550 }
1551#ifdef HAVE_PSI_INTERFACE
1549 PSI_register(mutex);1552 PSI_register(mutex);
1550 PSI_register(cond);1553 PSI_register(cond);
1551 PSI_register(thread);1554 PSI_register(thread);
1555#endif
1552 1556
1553 pool_timer.tick_interval= threadpool_stall_limit;1557 pool_timer.tick_interval= threadpool_stall_limit;
1554 start_timer(&pool_timer);1558 start_timer(&pool_timer);

Subscribers

People subscribed via source and target branches