summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@oracle.com>2011-01-11 10:07:37 +0100
committerMagne Mahre <magne.mahre@oracle.com>2011-01-11 10:07:37 +0100
commit8ede0759c30bb49025b466a69951d5f36d2b6b92 (patch)
tree5aa89e155e701ad4709cbd1e6a9efc5b5f1bb755 /storage
parent5511a9d7ba6e60cfff30ae414155e8aba6e3d30a (diff)
downloadmariadb-git-8ede0759c30bb49025b466a69951d5f36d2b6b92.tar.gz
Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds.
Diffstat (limited to 'storage')
-rw-r--r--storage/heap/heapdef.h7
-rw-r--r--storage/heap/hp_block.c2
-rw-r--r--storage/heap/hp_create.c4
-rw-r--r--storage/heap/hp_open.c2
-rw-r--r--storage/heap/hp_static.c4
-rw-r--r--storage/heap/hp_test2.c8
-rw-r--r--storage/myisam/ha_myisam.cc7
-rw-r--r--storage/myisam/mi_check.c6
-rw-r--r--storage/myisam/mi_close.c2
-rw-r--r--storage/myisam/mi_delete.c3
-rw-r--r--storage/myisam/mi_delete_all.c2
-rw-r--r--storage/myisam/mi_dynrec.c5
-rw-r--r--storage/myisam/mi_log.c4
-rw-r--r--storage/myisam/mi_open.c6
-rw-r--r--storage/myisam/mi_static.c2
-rw-r--r--storage/myisam/mi_statrec.c3
-rw-r--r--storage/myisam/mi_update.c2
-rw-r--r--storage/myisam/mi_write.c4
-rw-r--r--storage/myisam/myisamdef.h16
-rw-r--r--storage/myisam/sort.c2
-rw-r--r--storage/myisammrg/myrg_def.h2
21 files changed, 12 insertions, 81 deletions
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index bc3c6bf7239..87866678c2f 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -17,9 +17,7 @@
#include <my_base.h> /* This includes global */
C_MODE_START
-#ifdef THREAD
#include <my_pthread.h>
-#endif
#include "heap.h" /* Structs & some defines */
#include "my_tree.h"
@@ -102,14 +100,11 @@ extern void hp_clear(HP_SHARE *info);
extern void hp_clear_keys(HP_SHARE *info);
extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
key_part_map keypart_map);
-#ifdef THREAD
+
extern mysql_mutex_t THR_LOCK_heap;
-#endif
#ifdef HAVE_PSI_INTERFACE
-#ifdef THREAD
extern PSI_mutex_key hp_key_mutex_HP_SHARE_intern_lock;
-#endif /* THREAD */
void init_heap_psi_keys();
#endif /* HAVE_PSI_INTERFACE */
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 7f6cc1ef90a..41391fba060 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -86,7 +86,6 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
}
else
{
- dont_break(); /* Dont allow SIGHUP or SIGINT */
if ((uint) i == block->levels)
{
/* Adding a new level on top of the existing ones. */
@@ -117,7 +116,6 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
allocated bytes. Use it as a leaf block.
*/
block->level_info[0].last_blocks= root;
- allow_break(); /* Allow SIGHUP & SIGINT */
}
return 0;
}
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index bbf649c5e46..67fe0b3136f 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -192,11 +192,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
my_free(share);
goto err;
}
-#ifdef THREAD
thr_lock_init(&share->lock);
mysql_mutex_init(hp_key_mutex_HP_SHARE_intern_lock,
&share->intern_lock, MY_MUTEX_INIT_FAST);
-#endif
if (!create_info->internal_table)
{
share->open_list.data= (void*) share;
@@ -301,10 +299,8 @@ void hp_free(HP_SHARE *share)
if (share->open_list.data) /* If not internal table */
heap_share_list= list_delete(heap_share_list, &share->open_list);
hp_clear(share); /* Remove blocks from memory */
-#ifdef THREAD
thr_lock_delete(&share->lock);
mysql_mutex_destroy(&share->intern_lock);
-#endif
my_free(share->name);
my_free(share);
return;
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index 12d9bfe1ed3..5ac4da22e0a 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -37,9 +37,7 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
DBUG_RETURN(0);
}
share->open_count++;
-#ifdef THREAD
thr_lock_data_init(&share->lock,&info->lock,NULL);
-#endif
info->s= share;
info->lastkey= (uchar*) (info + 1);
info->recbuf= (uchar*) (info->lastkey + share->max_key_length);
diff --git a/storage/heap/hp_static.c b/storage/heap/hp_static.c
index e1ca7d1f445..a58ecb8b754 100644
--- a/storage/heap/hp_static.c
+++ b/storage/heap/hp_static.c
@@ -25,7 +25,6 @@
LIST *heap_open_list=0,*heap_share_list=0;
#ifdef HAVE_PSI_INTERFACE
-#ifdef THREAD
PSI_mutex_key hp_key_mutex_HP_SHARE_intern_lock;
static PSI_mutex_info all_heap_mutexes[]=
@@ -36,11 +35,9 @@ static PSI_mutex_info all_heap_mutexes[]=
THR_LOCK_heap is part of mysys, not storage/heap.
*/
};
-#endif /* THREAD */
void init_heap_psi_keys()
{
-#ifdef THREAD
const char* category= "memory";
int count;
@@ -49,7 +46,6 @@ void init_heap_psi_keys()
count= array_elements(all_heap_mutexes);
PSI_server->register_mutex(category, all_heap_mutexes, count);
-#endif /* THREAD */
}
#endif /* HAVE_PSI_INTERFACE */
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 3ee903be7ed..af388867c3c 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003, 2006 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
@@ -656,11 +657,6 @@ static int rnd(int max_value)
static sig_handler endprog(int sig_number __attribute__((unused)))
{
-#ifndef THREAD
- if (my_dont_interrupt)
- my_remember_signal(sig_number,endprog);
- else
-#endif
{
hp_panic(HA_PANIC_CLOSE);
my_end(1);
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index c4bb6d7dbd4..c7b6b2239ce 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -168,10 +168,9 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
Also we likely need to lock mutex here (in both cases with protocol and
push_warning).
*/
-#ifdef THREAD
if (param->need_print_msg_lock)
mysql_mutex_lock(&param->print_msg_mutex);
-#endif
+
protocol->prepare_for_resend();
protocol->store(name, length, system_charset_info);
protocol->store(param->op_name, system_charset_info);
@@ -180,10 +179,10 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
if (protocol->write())
sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n",
msgbuf);
-#ifdef THREAD
+
if (param->need_print_msg_lock)
mysql_mutex_unlock(&param->print_msg_mutex);
-#endif
+
return;
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 79a8105f823..5d8a7c3daef 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -99,9 +99,7 @@ void myisamchk_init(MI_CHECK *param)
param->max_record_length= LONGLONG_MAX;
param->key_cache_block_size= KEY_CACHE_BLOCK_SIZE;
param->stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
-#ifdef THREAD
param->need_print_msg_lock= 0;
-#endif
}
/* Check the status flags for the table */
@@ -2631,9 +2629,6 @@ err:
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick)
{
-#ifndef THREAD
- return mi_repair_by_sort(param, info, name, rep_quick);
-#else
int got_error;
uint i,key, total_key_length, istep;
ulong rec_length;
@@ -3122,7 +3117,6 @@ err:
share->pack.header_length=0;
}
DBUG_RETURN(got_error);
-#endif /* THREAD */
}
/* Read next record and return next key */
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index 51408ab191c..105ee3810cd 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -91,7 +91,6 @@ int mi_close(register MI_INFO *info)
my_free(share->decode_trees);
my_free(share->decode_tables);
}
-#ifdef THREAD
thr_lock_delete(&share->lock);
mysql_mutex_destroy(&share->intern_lock);
{
@@ -102,7 +101,6 @@ int mi_close(register MI_INFO *info)
mysql_rwlock_destroy(&share->key_root_lock[i]);
}
}
-#endif
my_free(info->s);
}
mysql_mutex_unlock(&THR_LOCK_myisam);
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 9314148cd8c..5fa7cba7d5e 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -102,7 +102,7 @@ int mi_delete(MI_INFO *info,const uchar *record)
mi_sizestore(lastpos,info->lastpos);
myisam_log_command(MI_LOG_DELETE,info,(uchar*) lastpos,sizeof(lastpos),0);
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
+
if (info->invalidator != 0)
{
DBUG_PRINT("info", ("invalidator... '%s' (delete)", info->filename));
@@ -122,7 +122,6 @@ err:
}
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
- allow_break(); /* Allow SIGHUP & SIGINT */
my_errno=save_errno;
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index 7a2e24189e6..cc610b73839 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -66,7 +66,6 @@ int mi_delete_all_rows(MI_INFO *info)
if (share->file_map)
mi_dynmap_file(info, (my_off_t) 0);
#endif
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
err:
@@ -74,7 +73,6 @@ err:
int save_errno=my_errno;
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
}
} /* mi_delete */
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index f429edd2759..8b407a36d6f 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -39,13 +39,11 @@ static int delete_dynamic_record(MI_INFO *info,my_off_t filepos,
static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length);
-#ifdef THREAD
/* Play it safe; We have a small stack when using threads */
#undef my_alloca
#undef my_afree
#define my_alloca(A) my_malloc((A),MYF(0))
#define my_afree(A) my_free((A))
-#endif
/* Interface function from MI_INFO */
@@ -1579,9 +1577,6 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const uchar *record)
MI_BLOCK_INFO block_info;
DBUG_ENTER("_mi_cmp_dynamic_record");
- /* We are going to do changes; dont let anybody disturb */
- dont_break(); /* Dont allow SIGHUP or SIGINT */
-
if (info->opt_flag & WRITE_CACHE_USED)
{
info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK);
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index 5af4a057a95..4b207f48e1c 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -24,11 +24,7 @@
#endif
#undef GETPID /* For HPUX */
-#ifdef THREAD
#define GETPID() (log_type == 1 ? (long) myisam_pid : (long) my_thread_dbug_id())
-#else
-#define GETPID() myisam_pid
-#endif
/* Activate logging if flag is 1 and reset logging if flag is 0 */
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index e3c29909067..6efcfd8862f 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -286,9 +286,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
&share->state.key_root,keys*sizeof(my_off_t),
&share->state.key_del,
(share->state.header.max_block_size_index*sizeof(my_off_t)),
-#ifdef THREAD
&share->key_root_lock, sizeof(mysql_rwlock_t)*keys,
-#endif
&share->mmap_lock, sizeof(mysql_rwlock_t),
NullS))
goto err;
@@ -498,7 +496,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
my_afree(disk_cache);
mi_setup_functions(share);
share->is_log_table= FALSE;
-#ifdef THREAD
thr_lock_init(&share->lock);
mysql_mutex_init(mi_key_mutex_MYISAM_SHARE_intern_lock,
&share->intern_lock, MY_MUTEX_INIT_FAST);
@@ -528,7 +525,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->lock.check_status=mi_check_status;
}
}
-#endif
/*
Memory mapping can only be requested after initializing intern_lock.
*/
@@ -625,9 +621,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
bzero(info.rec_buff, mi_get_rec_buff_len(&info, info.rec_buff));
*m_info=info;
-#ifdef THREAD
thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info);
-#endif
m_info->open_list.data=(void*) m_info;
myisam_open_list=list_add(myisam_open_list,&m_info->open_list);
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 55967fc9001..711287ca16f 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -32,7 +32,7 @@ File myisam_log_file= -1;
uint myisam_quick_table_bits=9;
ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */
my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0;
-#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
+#if !defined(DONT_USE_RW_LOCKS)
ulong myisam_concurrent_insert= 2;
#else
ulong myisam_concurrent_insert= 0;
diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c
index f83afa3c886..bf791726aa9 100644
--- a/storage/myisam/mi_statrec.c
+++ b/storage/myisam/mi_statrec.c
@@ -114,9 +114,6 @@ int _mi_cmp_static_record(register MI_INFO *info, register const uchar *old)
{
DBUG_ENTER("_mi_cmp_static_record");
- /* We are going to do changes; dont let anybody disturb */
- dont_break(); /* Dont allow SIGHUP or SIGINT */
-
if (info->opt_flag & WRITE_CACHE_USED)
{
if (flush_io_cache(&info->rec_cache))
diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c
index b538bcd0bb1..a9aad421235 100644
--- a/storage/myisam/mi_update.c
+++ b/storage/myisam/mi_update.c
@@ -179,7 +179,6 @@ int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec)
there is no index change there could be data change.
*/
(void) _mi_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
if (info->invalidator != 0)
{
DBUG_PRINT("info", ("invalidator... '%s' (update)", info->filename));
@@ -230,7 +229,6 @@ err:
err_end:
myisam_log_record(MI_LOG_UPDATE,info,newrec,info->lastpos,my_errno);
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
mi_print_error(info->s, HA_ERR_CRASHED);
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index bd56bb04f65..f3fbb7206e2 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -60,7 +60,7 @@ int mi_write(MI_INFO *info, uchar *record)
}
if (_mi_readinfo(info,F_WRLCK,1))
DBUG_RETURN(my_errno);
- dont_break(); /* Dont allow SIGHUP or SIGINT */
+
filepos= ((share->state.dellink != HA_OFFSET_ERROR &&
!info->append_insert_at_end) ?
share->state.dellink :
@@ -169,7 +169,6 @@ int mi_write(MI_INFO *info, uchar *record)
if (share->is_log_table)
mi_update_status((void*) info);
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
err:
@@ -228,7 +227,6 @@ err2:
save_errno=my_errno;
myisam_log_record(MI_LOG_WRITE,info,record,filepos,my_errno);
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
} /* mi_write */
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index c7f0cb27a40..133d0cec9eb 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -18,12 +18,8 @@
#include "myisam.h" /* Structs & some defines */
#include "myisampack.h" /* packing of keys */
#include <my_tree.h>
-#ifdef THREAD
#include <my_pthread.h>
#include <thr_lock.h>
-#else
-#include <my_no_pthread.h>
-#endif
#include <mysql/psi/mysql_file.h>
/* undef map from my_nosys; We need test-if-disk full */
@@ -211,11 +207,10 @@ typedef struct st_mi_isam_share { /* Shared between opens */
not_flushed,
temporary,delay_key_write,
concurrent_insert;
-#ifdef THREAD
+
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
mysql_rwlock_t *key_root_lock;
-#endif
my_off_t mmaped_length;
uint nonmmaped_inserts; /* counter of writing in non-mmaped
area */
@@ -298,9 +293,7 @@ struct st_myisam_info {
#ifdef __WIN__
my_bool owned_by_merge; /* This MyISAM table is part of a merge union */
#endif
-#ifdef THREAD
THR_LOCK_DATA lock;
-#endif
uchar *rtree_recursion_state; /* For RTREE */
int rtree_recursion_depth;
};
@@ -461,10 +454,9 @@ typedef struct st_mi_sort_param
#define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT
#define mi_unique_store(A,B) mi_int4store((A),(B))
-#ifdef THREAD
extern mysql_mutex_t THR_LOCK_myisam;
-#endif
-#if !defined(THREAD) || defined(DONT_USE_RW_LOCKS)
+
+#if defined(DONT_USE_RW_LOCKS)
#define mysql_rwlock_wrlock(A) {}
#define mysql_rwlock_rdlock(A) {}
#define mysql_rwlock_unlock(A) {}
@@ -774,9 +766,7 @@ void mi_check_print_info(MI_CHECK *param, const char *fmt,...);
int flush_pending_blocks(MI_SORT_PARAM *param);
int sort_ft_buf_flush(MI_SORT_PARAM *sort_param);
int thr_write_keys(MI_SORT_PARAM *sort_param);
-#ifdef THREAD
pthread_handler_t thr_find_all_keys(void *arg);
-#endif
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);
int sort_write_record(MI_SORT_PARAM *sort_param);
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 9532b9f0474..6630b99dd9c 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -302,7 +302,6 @@ static ha_rows find_all_keys(MI_SORT_PARAM *info, uint keys,
} /* find_all_keys */
-#ifdef THREAD
/* Search after all keys and place them in a temp. file */
pthread_handler_t thr_find_all_keys(void *arg)
@@ -637,7 +636,6 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
my_free(mergebuf);
DBUG_RETURN(got_error);
}
-#endif /* THREAD */
/* Write all keys in memory to file for later merge */
diff --git a/storage/myisammrg/myrg_def.h b/storage/myisammrg/myrg_def.h
index b916243be21..9bc0881b212 100644
--- a/storage/myisammrg/myrg_def.h
+++ b/storage/myisammrg/myrg_def.h
@@ -23,9 +23,7 @@
extern LIST *myrg_open_list;
-#ifdef THREAD
extern mysql_mutex_t THR_LOCK_open;
-#endif
int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag);
int _myrg_mi_read_record(MI_INFO *info, uchar *buf);