mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#2360 Performance schema
Part IV: sql instrumentation
This commit is contained in:
@ -1,7 +1,29 @@
|
||||
|
||||
/* Copyright (C) 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
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include "mysql_priv.h"
|
||||
#include "rpl_reporting.h"
|
||||
|
||||
Slave_reporting_capability::Slave_reporting_capability(char const *thread_name)
|
||||
: m_thread_name(thread_name)
|
||||
{
|
||||
mysql_mutex_init(key_mutex_slave_reporting_capability_err_lock,
|
||||
&err_lock, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
|
||||
void
|
||||
Slave_reporting_capability::report(loglevel level, int err_code,
|
||||
const char *msg, ...) const
|
||||
@ -13,7 +35,7 @@ Slave_reporting_capability::report(loglevel level, int err_code,
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
|
||||
pthread_mutex_lock(&err_lock);
|
||||
mysql_mutex_lock(&err_lock);
|
||||
switch (level)
|
||||
{
|
||||
case ERROR_LEVEL:
|
||||
@ -39,7 +61,7 @@ Slave_reporting_capability::report(loglevel level, int err_code,
|
||||
|
||||
my_vsnprintf(pbuff, pbuffsize, msg, args);
|
||||
|
||||
pthread_mutex_unlock(&err_lock);
|
||||
mysql_mutex_unlock(&err_lock);
|
||||
va_end(args);
|
||||
|
||||
/* If the msg string ends with '.', do not add a ',' it would be ugly */
|
||||
@ -51,5 +73,5 @@ Slave_reporting_capability::report(loglevel level, int err_code,
|
||||
|
||||
Slave_reporting_capability::~Slave_reporting_capability()
|
||||
{
|
||||
pthread_mutex_destroy(&err_lock);
|
||||
mysql_mutex_destroy(&err_lock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user