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

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
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
George Ormond Lorch III (community) g2 Approve
Review via email: mp+179667@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
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-04-03 10:26:31 +0000
3+++ Percona-Server/sql/threadpool_common.cc 2013-08-12 11:21:56 +0000
4@@ -75,14 +75,18 @@
5
6 void save()
7 {
8- psi_thread= PSI_server?PSI_server->get_thread():0;
9+#ifdef HAVE_PSI_INTERFACE
10+ psi_thread= PSI_server ? PSI_server->get_thread() : 0;
11+#endif
12 mysys_var= (st_my_thread_var *)pthread_getspecific(THR_KEY_mysys);
13 }
14
15 void restore()
16 {
17+#ifdef HAVE_PSI_INTERFACE
18 if (PSI_server)
19 PSI_server->set_thread(psi_thread);
20+#endif
21 pthread_setspecific(THR_KEY_mysys,mysys_var);
22 pthread_setspecific(THR_THD, 0);
23 pthread_setspecific(THR_MALLOC, 0);
24@@ -98,8 +102,10 @@
25 pthread_setspecific(THR_KEY_mysys,thd->mysys_var);
26 thd->thread_stack=(char*)&thd;
27 thd->store_globals();
28+#ifdef HAVE_PSI_INTERFACE
29 if (PSI_server)
30 PSI_server->set_thread(thd->event_scheduler.m_psi);
31+#endif
32 return 0;
33 }
34
35@@ -126,11 +132,13 @@
36 }
37
38 /* Create new PSI thread for use with the THD. */
39+#ifdef HAVE_PSI_INTERFACE
40 if (PSI_server)
41 {
42 thd->event_scheduler.m_psi =
43 PSI_server->new_thread(key_thread_one_connection, thd, thd->thread_id);
44 }
45+#endif
46
47
48 /* Login. */
49
50=== modified file 'Percona-Server/sql/threadpool_unix.cc'
51--- Percona-Server/sql/threadpool_unix.cc 2013-04-03 10:26:31 +0000
52+++ Percona-Server/sql/threadpool_unix.cc 2013-08-12 11:21:56 +0000
53@@ -53,6 +53,7 @@
54 */
55
56
57+#ifdef HAVE_PSI_INTERFACE
58 static PSI_mutex_key key_group_mutex;
59 static PSI_mutex_key key_timer_mutex;
60 static PSI_mutex_info mutex_list[]=
61@@ -80,6 +81,7 @@
62 /* Macro to simplify performance schema registration */
63 #define PSI_register(X) \
64 if(PSI_server) PSI_server->register_ ## X("threadpool", X ## _list, array_elements(X ## _list))
65+#endif
66
67
68 struct thread_group_t;
69@@ -1546,9 +1548,11 @@
70 sql_print_error("Can't set threadpool size to %d",threadpool_size);
71 DBUG_RETURN(1);
72 }
73+#ifdef HAVE_PSI_INTERFACE
74 PSI_register(mutex);
75 PSI_register(cond);
76 PSI_register(thread);
77+#endif
78
79 pool_timer.tick_interval= threadpool_stall_limit;
80 start_timer(&pool_timer);

Subscribers

People subscribed via source and target branches