mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#2360 Performance schema
Part III: mysys instrumentation
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002 MySQL AB
|
||||
/* Copyright (C) 2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -20,7 +20,7 @@
|
||||
#include "sp_cache.h"
|
||||
#include "sp_head.h"
|
||||
|
||||
static pthread_mutex_t Cversion_lock;
|
||||
static mysql_mutex_t Cversion_lock;
|
||||
static ulong volatile Cversion= 0;
|
||||
|
||||
|
||||
@ -75,12 +75,36 @@ private:
|
||||
HASH m_hashtable;
|
||||
}; // class sp_cache
|
||||
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
static PSI_mutex_key key_Cversion_lock;
|
||||
|
||||
static PSI_mutex_info all_sp_cache_mutexes[]=
|
||||
{
|
||||
{ &key_Cversion_lock, "Cversion_lock", PSI_FLAG_GLOBAL}
|
||||
};
|
||||
|
||||
static void init_sp_cache_psi_keys(void)
|
||||
{
|
||||
const char* category= "sql";
|
||||
int count;
|
||||
|
||||
if (PSI_server == NULL)
|
||||
return;
|
||||
|
||||
count= array_elements(all_sp_cache_mutexes);
|
||||
PSI_server->register_mutex(category, all_sp_cache_mutexes, count);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize the SP caching once at startup */
|
||||
|
||||
void sp_cache_init()
|
||||
{
|
||||
pthread_mutex_init(&Cversion_lock, MY_MUTEX_INIT_FAST);
|
||||
#ifdef HAVE_PSI_INTERFACE
|
||||
init_sp_cache_psi_keys();
|
||||
#endif
|
||||
|
||||
mysql_mutex_init(key_Cversion_lock, &Cversion_lock, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user