diff options
author | Marc Alff <marc.alff@sun.com> | 2010-01-06 22:42:07 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2010-01-06 22:42:07 -0700 |
commit | 3d915225611a921fad03934e58bf281b48fc15b0 (patch) | |
tree | ea8cbc9d70015a17aad75df30e7d223476eaa4da /sql/rpl_reporting.cc | |
parent | 4b559b912f5a3aa02a226fdacddaa3b80a8ade42 (diff) | |
download | mariadb-git-3d915225611a921fad03934e58bf281b48fc15b0.tar.gz |
WL#2360 Performance schema
Part IV: sql instrumentation
Diffstat (limited to 'sql/rpl_reporting.cc')
-rw-r--r-- | sql/rpl_reporting.cc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc index a09140de3c4..ae9d100eeb4 100644 --- a/sql/rpl_reporting.cc +++ b/sql/rpl_reporting.cc @@ -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); } |