Skip to content

Commit 48614b5

Browse files
author
Marc Alff
committed
local merge
2 parents a3748b1 + 5de3845 commit 48614b5

File tree

4 files changed

+34
-18
lines changed

4 files changed

+34
-18
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;

mysys/my_init.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ static MYSQL_FILE instrumented_stdin;
7474
*/
7575
my_bool my_basic_init(void)
7676
{
77+
char * str;
78+
7779
if (my_basic_init_done)
7880
return 0;
7981
my_basic_init_done= 1;
@@ -82,6 +84,19 @@ my_bool my_basic_init(void)
8284
my_umask= 0660; /* Default umask for new files */
8385
my_umask_dir= 0700; /* Default umask for new directories */
8486

87+
#ifndef VMS
88+
/* Default creation of new files */
89+
if ((str= getenv("UMASK")) != 0)
90+
my_umask= (int) (atoi_octal(str) | 0600);
91+
/* Default creation of new dir's */
92+
if ((str= getenv("UMASK_DIR")) != 0)
93+
my_umask_dir= (int) (atoi_octal(str) | 0700);
94+
#endif
95+
96+
/* $HOME is needed early to parse configuration files located in ~/ */
97+
if ((home_dir= getenv("HOME")) != 0)
98+
home_dir= intern_filename(home_dir_buff, home_dir);
99+
85100
init_glob_errs();
86101

87102
instrumented_stdin.m_file= stdin;
@@ -124,7 +139,6 @@ my_bool my_basic_init(void)
124139

125140
my_bool my_init(void)
126141
{
127-
char * str;
128142
if (my_init_done)
129143
return 0;
130144
my_init_done= 1;
@@ -142,24 +156,11 @@ my_bool my_init(void)
142156
{
143157
DBUG_ENTER("my_init");
144158
DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown"));
145-
if (!home_dir)
146-
{ /* Don't initialize twice */
147-
my_win_init();
148-
if ((home_dir=getenv("HOME")) != 0)
149-
home_dir=intern_filename(home_dir_buff,home_dir);
150-
#ifndef VMS
151-
/* Default creation of new files */
152-
if ((str=getenv("UMASK")) != 0)
153-
my_umask=(int) (atoi_octal(str) | 0600);
154-
/* Default creation of new dir's */
155-
if ((str=getenv("UMASK_DIR")) != 0)
156-
my_umask_dir=(int) (atoi_octal(str) | 0700);
157-
#endif
159+
my_win_init();
158160
#ifdef VMS
159-
init_ctype(); /* Stupid linker don't link _ctype.c */
161+
init_ctype(); /* Stupid linker don't link _ctype.c */
160162
#endif
161-
DBUG_PRINT("exit",("home: '%s'",home_dir));
162-
}
163+
DBUG_PRINT("exit", ("home: '%s'", home_dir));
163164
#ifdef __WIN__
164165
win32_init_tcp_ip();
165166
#endif

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)