diff options
Diffstat (limited to 'storage/myisam/mi_extra.c')
-rw-r--r-- | storage/myisam/mi_extra.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index f0ddc15b325..d8f4fc99c8e 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2005 MySQL AB +/* Copyright (C) 2000-2005 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 @@ -74,17 +74,17 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE) if ((share->options & HA_OPTION_COMPRESS_RECORD)) { - pthread_mutex_lock(&share->intern_lock); + mysql_mutex_lock(&share->intern_lock); if (_mi_memmap_file(info)) { /* We don't nead MADV_SEQUENTIAL if small file */ madvise((char*) share->file_map, share->state.state.data_file_length, share->state.state.data_file_length <= RECORD_CACHE_SIZE*16 ? MADV_RANDOM : MADV_SEQUENTIAL); - pthread_mutex_unlock(&share->intern_lock); + mysql_mutex_unlock(&share->intern_lock); break; } - pthread_mutex_unlock(&share->intern_lock); + mysql_mutex_unlock(&share->intern_lock); } #endif if (info->opt_flag & WRITE_CACHE_USED) @@ -252,16 +252,16 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) } break; case HA_EXTRA_FORCE_REOPEN: - pthread_mutex_lock(&THR_LOCK_myisam); + mysql_mutex_lock(&THR_LOCK_myisam); share->last_version= 0L; /* Impossible version */ - pthread_mutex_unlock(&THR_LOCK_myisam); + mysql_mutex_unlock(&THR_LOCK_myisam); break; case HA_EXTRA_PREPARE_FOR_DROP: - pthread_mutex_lock(&THR_LOCK_myisam); + mysql_mutex_lock(&THR_LOCK_myisam); share->last_version= 0L; /* Impossible version */ #ifdef __WIN__REMOVE_OBSOLETE_WORKAROUND /* Close the isam and data files as Win32 can't drop an open table */ - pthread_mutex_lock(&share->intern_lock); + mysql_mutex_lock(&share->intern_lock); if (flush_key_blocks(share->key_cache, share->kfile, (function == HA_EXTRA_FORCE_REOPEN ? FLUSH_RELEASE : FLUSH_IGNORE_CHANGED))) @@ -285,7 +285,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) } if (share->kfile >= 0) _mi_decrement_open_count(info); - if (share->kfile >= 0 && my_close(share->kfile,MYF(0))) + if (share->kfile >= 0 && mysql_file_close(share->kfile, MYF(0))) error=my_errno; { LIST *list_element ; @@ -296,16 +296,16 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) MI_INFO *tmpinfo=(MI_INFO*) list_element->data; if (tmpinfo->s == info->s) { - if (tmpinfo->dfile >= 0 && my_close(tmpinfo->dfile,MYF(0))) + if (tmpinfo->dfile >= 0 && mysql_file_close(tmpinfo->dfile, MYF(0))) error = my_errno; tmpinfo->dfile= -1; } } } share->kfile= -1; /* Files aren't open anymore */ - pthread_mutex_unlock(&share->intern_lock); + mysql_mutex_unlock(&share->intern_lock); #endif - pthread_mutex_unlock(&THR_LOCK_myisam); + mysql_mutex_unlock(&THR_LOCK_myisam); break; case HA_EXTRA_FLUSH: if (!share->temporary) @@ -316,9 +316,9 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) if (share->not_flushed) { share->not_flushed=0; - if (my_sync(share->kfile, MYF(0))) + if (mysql_file_sync(share->kfile, MYF(0))) error= my_errno; - if (my_sync(info->dfile, MYF(0))) + if (mysql_file_sync(info->dfile, MYF(0))) error= my_errno; if (error) { @@ -349,7 +349,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) break; case HA_EXTRA_MMAP: #ifdef HAVE_MMAP - pthread_mutex_lock(&share->intern_lock); + mysql_mutex_lock(&share->intern_lock); /* Memory map the data file if it is not already mapped. It is safe to memory map a file while other threads are using file I/O on it. @@ -370,13 +370,13 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) share->file_write= mi_mmap_pwrite; } } - pthread_mutex_unlock(&share->intern_lock); + mysql_mutex_unlock(&share->intern_lock); #endif break; case HA_EXTRA_MARK_AS_LOG_TABLE: - pthread_mutex_lock(&share->intern_lock); + mysql_mutex_lock(&share->intern_lock); share->is_log_table= TRUE; - pthread_mutex_unlock(&share->intern_lock); + mysql_mutex_unlock(&share->intern_lock); break; case HA_EXTRA_KEY_CACHE: case HA_EXTRA_NO_KEY_CACHE: |