summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-12-09 20:19:51 -0700
committerMarc Alff <marc.alff@sun.com>2009-12-09 20:19:51 -0700
commitc082955f0676efe069f30384102ba7807b49dee6 (patch)
treecc0a038191d1969182d5dd108c891ee10a436cc0 /include
parent6fd3866c6c104f8bc991d71583e627ae6fabe0ab (diff)
downloadmariadb-git-c082955f0676efe069f30384102ba7807b49dee6.tar.gz
WL#2360 Performance schema
Part III: mysys instrumentation
Diffstat (limited to 'include')
-rw-r--r--include/keycache.h4
-rw-r--r--include/my_bitmap.h4
-rw-r--r--include/my_pthread.h18
-rw-r--r--include/my_sys.h13
-rw-r--r--include/thr_lock.h9
5 files changed, 26 insertions, 22 deletions
diff --git a/include/keycache.h b/include/keycache.h
index a6005bae878..4e715dda88d 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (C) 2003 MySQL AB, 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
@@ -70,7 +70,7 @@ typedef struct st_key_cache
uchar HUGE_PTR *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
- pthread_mutex_t cache_lock; /* to lock access to the cache structure */
+ mysql_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
/*
Waiting for a zero resize count. Using a queue for symmetry though
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 78642df3362..314dac983b0 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000 MySQL AB, 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
@@ -34,7 +34,7 @@ typedef struct st_bitmap
acquiring the mutex
*/
#ifdef THREAD
- pthread_mutex_t *mutex;
+ mysql_mutex_t *mutex;
#endif
} MY_BITMAP;
diff --git a/include/my_pthread.h b/include/my_pthread.h
index c4d4e3d7adf..bfb5a2f67f4 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -607,6 +607,8 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
typedef ulong my_thread_id;
extern my_bool my_thread_global_init(void);
+extern my_bool my_thread_basic_global_init(void);
+extern void my_thread_basic_global_reinit(void);
extern void my_thread_global_end(void);
extern my_bool my_thread_init(void);
extern void my_thread_end(void);
@@ -637,10 +639,10 @@ extern int pthread_dummy(int);
struct st_my_thread_var
{
int thr_errno;
- pthread_cond_t suspend;
- pthread_mutex_t mutex;
- pthread_mutex_t * volatile current_mutex;
- pthread_cond_t * volatile current_cond;
+ mysql_cond_t suspend;
+ mysql_mutex_t mutex;
+ mysql_mutex_t * volatile current_mutex;
+ mysql_cond_t * volatile current_cond;
pthread_t pthread_self;
my_thread_id id;
int cmp_length;
@@ -692,16 +694,16 @@ extern uint thd_lib_detected;
#ifdef THREAD
#ifndef thread_safe_increment
#define thread_safe_increment(V,L) \
- (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
+ (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L)))
#define thread_safe_decrement(V,L) \
- (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
+ (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L)))
#endif
#ifndef thread_safe_add
#define thread_safe_add(V,C,L) \
- (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
+ (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L)))
#define thread_safe_sub(V,C,L) \
- (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
+ (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif
#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index f4217b17fee..6e66dc30f9b 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -338,7 +338,7 @@ struct st_my_file_info
#endif
enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
- pthread_mutex_t mutex;
+ mysql_mutex_t mutex;
#endif
};
@@ -358,7 +358,7 @@ typedef struct st_my_tmpdir
char **list;
uint cur, max;
#ifdef THREAD
- pthread_mutex_t mutex;
+ mysql_mutex_t mutex;
#endif
} MY_TMPDIR;
@@ -374,9 +374,9 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
#ifdef THREAD
typedef struct st_io_cache_share
{
- pthread_mutex_t mutex; /* To sync on reads into buffer. */
- pthread_cond_t cond; /* To wait for signals. */
- pthread_cond_t cond_writer; /* For a synchronized writer. */
+ mysql_mutex_t mutex; /* To sync on reads into buffer. */
+ mysql_cond_t cond; /* To wait for signals. */
+ mysql_cond_t cond_writer; /* For a synchronized writer. */
/* Offset in file corresponding to the first byte of buffer. */
my_off_t pos_in_file;
/* If a synchronized write cache is the source of the data. */
@@ -437,7 +437,7 @@ typedef struct st_io_cache /* Used when cacheing files */
The lock is for append buffer used in SEQ_READ_APPEND cache
need mutex copying from append buffer to read buffer.
*/
- pthread_mutex_t append_buffer_lock;
+ mysql_mutex_t append_buffer_lock;
/*
The following is used when several threads are reading the
same file in parallel. They are synchronized on disk
@@ -691,6 +691,7 @@ extern const char **my_error_unregister(int first, int last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
+extern my_bool my_basic_init(void);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);
diff --git a/include/thr_lock.h b/include/thr_lock.h
index fb70c57c0e7..d669d2dd2ab 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright 2000-2008 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
@@ -115,10 +115,11 @@ typedef struct st_thr_lock_data {
THR_LOCK_OWNER *owner;
struct st_thr_lock_data *next,**prev;
struct st_thr_lock *lock;
- pthread_cond_t *cond;
+ mysql_cond_t *cond;
enum thr_lock_type type;
void *status_param; /* Param to status functions */
void *debug_print_param;
+ struct PSI_table *m_psi;
} THR_LOCK_DATA;
struct st_lock_list {
@@ -127,7 +128,7 @@ struct st_lock_list {
typedef struct st_thr_lock {
LIST list;
- pthread_mutex_t mutex;
+ mysql_mutex_t mutex;
struct st_lock_list read_wait;
struct st_lock_list read;
struct st_lock_list write_wait;
@@ -144,7 +145,7 @@ typedef struct st_thr_lock {
extern LIST *thr_lock_thread_list;
-extern pthread_mutex_t THR_LOCK_lock;
+extern mysql_mutex_t THR_LOCK_lock;
my_bool init_thr_lock(void); /* Must be called once/thread */
#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg)