diff options
author | Magne Mahre <magne.mahre@oracle.com> | 2011-01-11 10:07:37 +0100 |
---|---|---|
committer | Magne Mahre <magne.mahre@oracle.com> | 2011-01-11 10:07:37 +0100 |
commit | ebd24626ca38e7fa1e3da2acdcf88540be70fabe (patch) | |
tree | 5aa89e155e701ad4709cbd1e6a9efc5b5f1bb755 /storage/myisam | |
parent | f6bcd9c6c5d860c9a6ad1b6411ffa9f48ed685c9 (diff) | |
download | mariadb-git-ebd24626ca38e7fa1e3da2acdcf88540be70fabe.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/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 7 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_close.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_delete.c | 3 | ||||
-rw-r--r-- | storage/myisam/mi_delete_all.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_dynrec.c | 5 | ||||
-rw-r--r-- | storage/myisam/mi_log.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_open.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_static.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_statrec.c | 3 | ||||
-rw-r--r-- | storage/myisam/mi_update.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_write.c | 4 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 16 | ||||
-rw-r--r-- | storage/myisam/sort.c | 2 |
14 files changed, 9 insertions, 55 deletions
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(¶m->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(¶m->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 */ |