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

Proposed by Sergei Glushchenko on 2013-08-12
Status: Merged
Approved by: Laurynas Biveinis on 2013-10-01
Approved revision: 408
Merged at revision: 441
Proposed branch: lp:~sergei.glushchenko/percona-server/5.6-ps-bug1196383
Merge into: lp:percona-server/5.6
Diff against target: 84 lines (+17/-10)
2 files modified
Percona-Server/sql/threadpool_common.cc (+13/-10)
Percona-Server/sql/threadpool_unix.cc (+4/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/5.6-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+179668@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
1=== modified file 'Percona-Server/sql/threadpool_common.cc'
2--- Percona-Server/sql/threadpool_common.cc 2013-05-27 03:01:29 +0000
3+++ Percona-Server/sql/threadpool_common.cc 2013-08-12 11:22:35 +0000
4@@ -76,14 +76,17 @@
5
6 void save()
7 {
8- psi_thread= PSI_server?PSI_server->get_thread():0;
9+#ifdef HAVE_PSI_THREAD_INTERFACE
10+ psi_thread= PSI_THREAD_CALL(get_thread)();
11+#endif
12 mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);
13 }
14
15 void restore()
16 {
17- if (PSI_server)
18- PSI_server->set_thread(psi_thread);
19+#ifdef HAVE_PSI_THREAD_INTERFACE
20+ PSI_THREAD_CALL(set_thread)(psi_thread);
21+#endif
22 pthread_setspecific(THR_KEY_mysys,mysys_var);
23 pthread_setspecific(THR_THD, 0);
24 pthread_setspecific(THR_MALLOC, 0);
25@@ -99,8 +102,9 @@
26 pthread_setspecific(THR_KEY_mysys,thd->mysys_var);
27 thd->thread_stack=(char*)&thd;
28 thd->store_globals();
29- if (PSI_server)
30- PSI_server->set_thread(thd->event_scheduler.m_psi);
31+#ifdef HAVE_PSI_THREAD_INTERFACE
32+ PSI_THREAD_CALL(set_thread)(thd->event_scheduler.m_psi);
33+#endif
34 mysql_socket_set_thread_owner(thd->net.vio->mysql_socket);
35 return 0;
36 }
37@@ -196,11 +200,10 @@
38 }
39
40 /* Create new PSI thread for use with the THD. */
41- if (PSI_server)
42- {
43- thd->event_scheduler.m_psi=
44- PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);
45- }
46+#ifdef HAVE_PSI_THREAD_INTERFACE
47+ thd->event_scheduler.m_psi=
48+ PSI_THREAD_CALL(new_thread)(key_thread_one_connection, thd, thd->thread_id);
49+#endif
50
51
52 /* Login. */
53
54=== modified file 'Percona-Server/sql/threadpool_unix.cc'
55--- Percona-Server/sql/threadpool_unix.cc 2013-05-27 03:01:29 +0000
56+++ Percona-Server/sql/threadpool_unix.cc 2013-08-12 11:22:35 +0000
57@@ -54,6 +54,7 @@
58 */
59
60
61+#ifdef HAVE_PSI_INTERFACE
62 static PSI_mutex_key key_group_mutex;
63 static PSI_mutex_key key_timer_mutex;
64 static PSI_mutex_info mutex_list[]=
65@@ -81,6 +82,7 @@
66 /* Macro to simplify performance schema registration */
67 #define PSI_register(X) \
68 if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
69+#endif
70
71
72 struct thread_group_t;
73@@ -1554,9 +1556,11 @@
74 sql_print_error("Can't set threadpool size to %d",threadpool_size);
75 DBUG_RETURN(1);
76 }
77+#ifdef HAVE_PSI_INTERFACE
78 PSI_register(mutex);
79 PSI_register(cond);
80 PSI_register(thread);
81+#endif
82
83 pool_timer.tick_interval= threadpool_stall_limit;
84 start_timer(&pool_timer);

Subscribers

People subscribed via source and target branches