Skip to content

Commit 8e5e420

Browse files
author
Marc Alff
committed
Bug#44210 Performance schema: pool-of-threads threads instrumentation is missing
WL#5136 Pool of threads Added an explicit delete_thread() API in the instrumentation, to be used by the pool of threads implementations.
1 parent d86d122 commit 8e5e420

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

include/mysql/psi/psi.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
1+
/* Copyright (C) 2008-2010 Sun Microsystems, Inc
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -614,6 +614,9 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
614614
/** Delete the current thread instrumentation. */
615615
typedef void (*delete_current_thread_v1_t)(void);
616616

617+
/** Delete a thread instrumentation. */
618+
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
619+
617620
/**
618621
Get a mutex instrumentation locker.
619622
@param mutex the instrumented mutex to lock
@@ -890,6 +893,8 @@ struct PSI_v1
890893
set_thread_v1_t set_thread;
891894
/** @sa delete_current_thread_v1_t. */
892895
delete_current_thread_v1_t delete_current_thread;
896+
/** @sa delete_thread_v1_t. */
897+
delete_thread_v1_t delete_thread;
893898
/** @sa get_thread_mutex_locker_v1_t. */
894899
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
895900
/** @sa get_thread_rwlock_locker_v1_t. */

include/mysql/psi/psi_abi_v1.h.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
typedef struct PSI_thread* (*get_thread_v1_t)(void);
128128
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
129129
typedef void (*delete_current_thread_v1_t)(void);
130+
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
130131
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
131132
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
132133
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
@@ -204,6 +205,7 @@
204205
get_thread_v1_t get_thread;
205206
set_thread_v1_t set_thread;
206207
delete_current_thread_v1_t delete_current_thread;
208+
delete_thread_v1_t delete_thread;
207209
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
208210
get_thread_rwlock_locker_v1_t get_thread_rwlock_locker;
209211
get_thread_cond_locker_v1_t get_thread_cond_locker;

storage/perfschema/pfs.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,13 @@ static void delete_current_thread_v1(void)
10811081
}
10821082
}
10831083

1084+
static void delete_thread_v1(PSI_thread *thread)
1085+
{
1086+
PFS_thread *pfs= reinterpret_cast<PFS_thread*> (thread);
1087+
if (pfs != NULL)
1088+
destroy_thread(pfs);
1089+
}
1090+
10841091
static PSI_mutex_locker*
10851092
get_thread_mutex_locker_v1(PSI_mutex *mutex, PSI_mutex_operation op)
10861093
{
@@ -2007,6 +2014,7 @@ PSI_v1 PFS_v1=
20072014
get_thread_v1,
20082015
set_thread_v1,
20092016
delete_current_thread_v1,
2017+
delete_thread_v1,
20102018
get_thread_mutex_locker_v1,
20112019
get_thread_rwlock_locker_v1,
20122020
get_thread_cond_locker_v1,

0 commit comments

Comments
 (0)