summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@dator8>2011-01-12 14:43:03 +0100
committerMikael Ronstrom <mikael@dator8>2011-01-12 14:43:03 +0100
commit773267552f6c701cf3210f908a3608ad0da1087f (patch)
tree2572fe5a1f81ea6ca0b1fa3d47f468b568ff5503 /include
parent7dae4282d4d5ec2ec8d17f600e87918e0a0aea00 (diff)
parentbbf40ba3c5cac76b4efd2dc177b9ffaff1ce9266 (diff)
downloadmariadb-git-773267552f6c701cf3210f908a3608ad0da1087f.tar.gz
merge
Diffstat (limited to 'include')
-rw-r--r--include/CMakeLists.txt1
-rw-r--r--include/heap.h10
-rw-r--r--include/my_base.h6
-rw-r--r--include/my_bitmap.h2
-rw-r--r--include/my_global.h24
-rw-r--r--include/my_no_pthread.h72
-rw-r--r--include/my_pthread.h8
-rw-r--r--include/my_sys.h25
-rw-r--r--include/myisam.h4
-rw-r--r--include/mysql/innodb_priv.h1
-rw-r--r--include/thr_alarm.h2
11 files changed, 14 insertions, 141 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index e89929d159d..d8bac7532cc 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -40,7 +40,6 @@ SET(HEADERS
my_xml.h
mysql_embed.h
my_pthread.h
- my_no_pthread.h
decimal.h
errmsg.h
my_global.h
diff --git a/include/heap.h b/include/heap.h
index a585371e18f..755a1aa3fed 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2004 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -25,10 +26,9 @@ extern "C" {
#ifndef _my_base_h
#include <my_base.h>
#endif
-#ifdef THREAD
+
#include <my_pthread.h>
#include <thr_lock.h>
-#endif
#include "my_handler.h"
#include "my_tree.h"
@@ -146,10 +146,8 @@ typedef struct st_heap_share
uint open_count;
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
-#ifdef THREAD
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
-#endif
my_bool delete_on_close;
LIST open_list;
uint auto_key;
@@ -175,9 +173,7 @@ typedef struct st_heap_info
TREE_ELEMENT **last_pos;
uint lastkey_len;
my_bool implicit_emptied;
-#ifdef THREAD
THR_LOCK_DATA lock;
-#endif
LIST open_list;
} HP_INFO;
diff --git a/include/my_base.h b/include/my_base.h
index 83b02bfd833..347bda01bef 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -30,9 +31,6 @@
#define EOVERFLOW 84
#endif
-#if !defined(USE_MY_FUNC) && !defined(THREAD)
-#include <my_nosys.h> /* For faster code, after test */
-#endif /* USE_MY_FUNC */
#endif /* stdin */
#include <my_list.h>
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 548eec14d6e..78b33b09a51 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -33,9 +33,7 @@ typedef struct st_bitmap
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
acquiring the mutex
*/
-#ifdef THREAD
mysql_mutex_t *mutex;
-#endif
} MY_BITMAP;
#ifdef __cplusplus
diff --git a/include/my_global.h b/include/my_global.h
index a411ab8a118..c1ae8a6d6bc 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -212,13 +212,6 @@
#include <sys/types.h>
#endif
-/* The client defines this to avoid all thread code */
-#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
-#undef THREAD
-#undef HAVE_LINUXTHREADS
-#undef HAVE_NPTL
-#endif
-
#ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H
@@ -261,7 +254,7 @@
#endif
#endif
-#if defined(THREAD) && !defined(__WIN__)
+#if !defined(__WIN__)
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif
@@ -282,7 +275,7 @@ C_MODE_END
#if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT 1 /* Threads requires reentrant code */
#endif
-#endif /* THREAD */
+#endif /* !defined(__WIN__) */
/* Go around some bugs in different OS and compilers */
#ifdef _AIX /* By soren@t.dk */
@@ -415,7 +408,7 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
-#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
+#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
/* Fix bug in setrlimit */
#undef setrlimit
#define setrlimit cma_setrlimit64
@@ -1342,17 +1335,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */
-#ifndef THREAD
-#define thread_safe_increment(V,L) (V)++
-#define thread_safe_decrement(V,L) (V)--
-#define thread_safe_add(V,C,L) (V)+=(C)
-#define thread_safe_sub(V,C,L) (V)-=(C)
-#define statistic_increment(V,L) (V)++
-#define statistic_decrement(V,L) (V)--
-#define statistic_add(V,C,L) (V)+=(C)
-#define statistic_sub(V,C,L) (V)-=(C)
-#endif
-
#ifdef HAVE_CHARSET_utf8
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
deleted file mode 100644
index 633a5b94a6c..00000000000
--- a/include/my_no_pthread.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef MY_NO_PTHREAD_INCLUDED
-#define MY_NO_PTHREAD_INCLUDED
-
-/* 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
- 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 */
-
-
-#ifndef THREAD
-
-/*
- This block is to access some thread-related type definitions
- even in builds which do not need thread functions,
- as some variables (based on these types) are declared
- even in non-threaded builds.
- Case in point: 'mf_keycache.c'
-*/
-#if defined(__WIN__)
-#else /* Normal threads */
-#include <pthread.h>
-
-#endif /* defined(__WIN__) */
-
-
-/*
- This undefs some pthread mutex locks when one isn't using threads
- to make thread safe code, that should also work in single thread
- environment, easier to use.
-*/
-#define pthread_mutex_init(A,B)
-#define pthread_mutex_lock(A)
-#define pthread_mutex_unlock(A)
-#define pthread_mutex_destroy(A)
-#define my_rwlock_init(A,B)
-#define rw_rdlock(A)
-#define rw_wrlock(A)
-#define rw_unlock(A)
-#define rwlock_destroy(A)
-#define safe_mutex_assert_owner(mp)
-
-#define mysql_mutex_init(A, B, C) do {} while (0)
-#define mysql_mutex_lock(A) do {} while (0)
-#define mysql_mutex_unlock(A) do {} while (0)
-#define mysql_mutex_destroy(A) do {} while (0)
-
-#define mysql_rwlock_init(A, B, C) do {} while (0)
-#define mysql_rwlock_rdlock(A) do {} while (0)
-#define mysql_rwlock_wrlock(A) do {} while (0)
-#define mysql_rwlock_unlock(A) do {} while (0)
-#define mysql_rwlock_destroy(A) do {} while (0)
-
-typedef int my_pthread_once_t;
-#define MY_PTHREAD_ONCE_INIT 0
-#define MY_PTHREAD_ONCE_DONE 1
-
-#define my_pthread_once(C,F) do { \
- if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
- } while(0)
-
-#endif
-#endif /* MY_NO_PTHREAD_INCLUDED */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index c71ad9bf321..f1636cad136 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -881,12 +881,6 @@ extern uint thd_lib_detected;
to use my_atomic operations instead.
*/
-/*
- Warning:
- When compiling without threads, this file is not included.
- See the *other* declarations of thread_safe_xxx in include/my_global.h
-*/
-#ifdef THREAD
#ifndef thread_safe_increment
#ifdef _WIN32
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
@@ -910,7 +904,7 @@ extern uint thd_lib_detected;
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif
#endif
-#endif
+
/*
statistics_xxx functions are for non critical statistic,
diff --git a/include/my_sys.h b/include/my_sys.h
index 7ece2fede95..b5aa8696767 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -41,11 +41,7 @@ typedef struct my_aio_result {
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
#endif /* HAVE_VALGRIND */
-#ifndef THREAD
-extern int my_errno; /* Last error in mysys */
-#else
#include <my_pthread.h>
-#endif
#include <m_ctype.h> /* for CHARSET_INFO */
#include <stdarg.h>
@@ -314,7 +310,7 @@ struct st_my_file_info
int oflag; /* open flags, e.g O_APPEND */
#endif
enum file_type type;
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_t mutex;
#endif
};
@@ -334,9 +330,7 @@ typedef struct st_my_tmpdir
DYNAMIC_ARRAY full_list;
char **list;
uint cur, max;
-#ifdef THREAD
mysql_mutex_t mutex;
-#endif
} MY_TMPDIR;
typedef struct st_dynamic_string
@@ -348,7 +342,6 @@ typedef struct st_dynamic_string
struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
-#ifdef THREAD
typedef struct st_io_cache_share
{
mysql_mutex_t mutex; /* To sync on reads into buffer. */
@@ -368,7 +361,6 @@ typedef struct st_io_cache_share
my_bool alloced;
#endif
} IO_CACHE_SHARE;
-#endif
typedef struct st_io_cache /* Used when cacheing files */
{
@@ -409,7 +401,7 @@ typedef struct st_io_cache /* Used when cacheing files */
WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/
uchar **current_pos, **current_end;
-#ifdef THREAD
+
/*
The lock is for append buffer used in SEQ_READ_APPEND cache
need mutex copying from append buffer to read buffer.
@@ -423,7 +415,7 @@ typedef struct st_io_cache /* Used when cacheing files */
READ_CACHE mode is supported.
*/
IO_CACHE_SHARE *share;
-#endif
+
/*
A caller will use my_b_read() macro to read from the cache
if the data is already in cache, it will be simply copied with
@@ -631,6 +623,7 @@ extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
+extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
@@ -657,14 +650,6 @@ extern int my_redel(const char *from, const char *to, int MyFlags);
extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd);
-#ifndef THREAD
-extern void dont_break(void);
-extern void allow_break(void);
-#else
-#define dont_break()
-#define allow_break()
-#endif
-
#ifdef EXTRA_DEBUG
void my_print_open_files(void);
#else
@@ -737,12 +722,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
-#ifdef THREAD
extern int _my_b_read_r(IO_CACHE *info,uchar *Buffer,size_t Count);
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
IO_CACHE *write_cache, uint num_threads);
extern void remove_io_thread(IO_CACHE *info);
-#endif
extern int _my_b_seq_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_net_read(IO_CACHE *info,uchar *Buffer,size_t Count);
extern int _my_b_get(IO_CACHE *info);
diff --git a/include/myisam.h b/include/myisam.h
index c4076ead403..cb641e12e8e 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -433,10 +433,8 @@ typedef struct st_mi_check_param
const char *db_name, *table_name;
const char *op_name;
enum_mi_stats_method stats_method;
-#ifdef THREAD
mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock;
-#endif
} MI_CHECK;
typedef struct st_sort_ft_buf
@@ -460,10 +458,8 @@ typedef struct st_sort_info
SORT_FT_BUF *ft_buf;
/* sync things */
uint got_error, threads_running;
-#ifdef THREAD
mysql_mutex_t mutex;
mysql_cond_t cond;
-#endif
} SORT_INFO;
/* functions in mi_check */
diff --git a/include/mysql/innodb_priv.h b/include/mysql/innodb_priv.h
index 993dad7cf99..5406c292b18 100644
--- a/include/mysql/innodb_priv.h
+++ b/include/mysql/innodb_priv.h
@@ -22,7 +22,6 @@
class THD;
-uint filename_to_tablename(const char *from, char *to, uint to_length);
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
bool schema_table_store_record(THD *thd, TABLE *table);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 8d7f5bcdee0..8c91fc0b899 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -41,7 +41,7 @@ typedef struct st_alarm_info
void thr_alarm_info(ALARM_INFO *info);
-#if defined(DONT_USE_THR_ALARM) || !defined(THREAD)
+#if defined(DONT_USE_THR_ALARM)
#define USE_ALARM_THREAD
#undef USE_ONE_SIGNAL_HAND