summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-15 21:45:22 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-15 21:45:22 +0300
commitc9cd0f0b75b6dcaacef5db6eabd31e262ecd7be4 (patch)
treec5bdf39edfe6126050810bb9269e5bb4fc8cf16d /mysys
parent6331ef3efd56d995fd7a82b7325a2615750766ad (diff)
parent6fd3866c6c104f8bc991d71583e627ae6fabe0ab (diff)
downloadmariadb-git-c9cd0f0b75b6dcaacef5db6eabd31e262ecd7be4.tar.gz
Merge next-mr -> next-4284.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_static.c28
-rw-r--r--mysys/my_winthread.c6
-rw-r--r--mysys/mysys_priv.h48
3 files changed, 76 insertions, 6 deletions
diff --git a/mysys/my_static.c b/mysys/my_static.c
index 62caeee89c4..a86fe6c7ab7 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -124,3 +124,31 @@ my_bool NEAR my_disable_async_io=0;
my_bool NEAR my_disable_flush_key_blocks=0;
my_bool NEAR my_disable_symlinks=0;
my_bool NEAR mysys_uses_curses=0;
+
+/*
+ Note that PSI_hook and PSI_server are unconditionally
+ (no ifdef HAVE_PSI_INTERFACE) defined.
+ This is to ensure binary compatibility between the server and plugins,
+ in the case when:
+ - the server is not compiled with HAVE_PSI_INTERFACE
+ - a plugin is compiled with HAVE_PSI_INTERFACE
+ See the doxygen documentation for the performance schema.
+*/
+
+/**
+ Hook for the instrumentation interface.
+ Code implementing the instrumentation interface should register here.
+*/
+struct PSI_bootstrap *PSI_hook= NULL;
+
+/**
+ Instance of the instrumentation interface for the MySQL server.
+ @todo This is currently a global variable, which is handy when
+ compiling instrumented code that is bundled with the server.
+ When dynamic plugin are truly supported, this variable will need
+ to be replaced by a macro, so that each XYZ plugin can have it's own
+ xyz_psi_server variable, obtained from PSI_bootstrap::get_interface()
+ with the version used at compile time for plugin XYZ.
+*/
+PSI *PSI_server= NULL;
+
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 9e8458b0799..f3d643975b3 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000 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
@@ -63,8 +63,8 @@ static unsigned int __stdcall pthread_start(void *p)
}
-int pthread_create(pthread_t *thread_id, pthread_attr_t *attr,
- pthread_handler func, void *param)
+int pthread_create(pthread_t *thread_id, const pthread_attr_t *attr,
+ pthread_handler func, void *param)
{
uintptr_t handle;
struct thread_start_parameter *par;
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 4c4d6ea3598..5c5bd6c2908 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000 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
@@ -26,12 +26,54 @@
#ifdef THREAD
#include <my_pthread.h>
+
+#ifdef HAVE_PSI_INTERFACE
+
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
+extern PSI_mutex_key key_my_file_info_mutex;
+#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */
+
+#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
+extern PSI_mutex_key key_LOCK_localtime_r;
+#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
+
+#ifndef HAVE_GETHOSTBYNAME_R
+extern PSI_mutex_key key_LOCK_gethostbyname_r;
+#endif /* HAVE_GETHOSTBYNAME_R */
+
+extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
+ key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
+ key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,
+ key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc,
+ key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
+ key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time,
+ key_TMPDIR_mutex;
+
+extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond,
+ key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend,
+ key_THR_COND_threads;
+
+#ifdef USE_ALARM_THREAD
+extern PSI_thread_key key_thread_alarm;
+#endif /* USE_ALARM_THREAD */
+
+#endif /* HAVE_PSI_INTERFACE */
+
extern pthread_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
extern pthread_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net;
extern pthread_mutex_t THR_LOCK_charset, THR_LOCK_time;
-#else
+#else /* THREAD */
#include <my_no_pthread.h>
-#endif
+#endif /* THREAD */
+
+#include <mysql/psi/mysql_file.h>
+
+#ifdef HAVE_PSI_INTERFACE
+#ifdef HUGETLB_USE_PROC_MEMINFO
+extern PSI_file_key key_file_proc_meminfo;
+#endif /* HUGETLB_USE_PROC_MEMINFO */
+extern PSI_file_key key_file_charset, key_file_cnf;
+#endif /* HAVE_PSI_INTERFACE */
/*
EDQUOT is used only in 3 C files only in mysys/. If it does not exist on