diff options
author | monty@mysql.com <> | 2006-06-19 12:45:34 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2006-06-19 12:45:34 +0300 |
commit | 860661a2dc5905396f1e6ee4b163bdf29dc2b6fe (patch) | |
tree | b1eef84ec3b6195237d928b1ebea0aaa0acf90a7 /mysys | |
parent | 37d7bbb335fd3d3c578a724790ce5f5cbc049ce9 (diff) | |
download | mariadb-git-860661a2dc5905396f1e6ee4b163bdf29dc2b6fe.tar.gz |
unsigned char -> uchar
Added missing copyright
Indentation and prototype fixes
Fixed compiler warning
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_keycache.c | 23 | ||||
-rw-r--r-- | mysys/my_error.c | 4 | ||||
-rw-r--r-- | mysys/my_memmem.c | 19 |
3 files changed, 41 insertions, 5 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 71d73048a7b..e6f4348968f 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -470,8 +470,10 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, uint age_threshold) { int blocks; +#ifdef THREAD struct st_my_thread_var *thread; KEYCACHE_WQUEUE *wqueue; +#endif DBUG_ENTER("resize_key_cache"); if (!keycache->key_cache_inited) @@ -1102,8 +1104,12 @@ static void unreg_request(KEY_CACHE *keycache, static inline void remove_reader(BLOCK_LINK *block) { +#ifdef THREAD if (! --block->hash_link->requests && block->condvar) keycache_pthread_cond_signal(block->condvar); +#else + --block->hash_link->requests; +#endif } @@ -1112,7 +1118,8 @@ static inline void remove_reader(BLOCK_LINK *block) signals on its termination */ -static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block) +static inline void wait_for_readers(KEY_CACHE *keycache __attribute__((unused)), + BLOCK_LINK *block) { #ifdef THREAD struct st_my_thread_var *thread= my_thread_var; @@ -1209,7 +1216,6 @@ static HASH_LINK *get_hash_link(KEY_CACHE *keycache, int file, my_off_t filepos) { reg1 HASH_LINK *hash_link, **start; - KEYCACHE_PAGE page; #if defined(KEYCACHE_DEBUG) int cnt; #endif @@ -1264,6 +1270,7 @@ restart: #ifdef THREAD /* Wait for a free hash link */ struct st_my_thread_var *thread= my_thread_var; + KEYCACHE_PAGE page; KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting")); page.file= file; page.filepos= filepos; @@ -1588,8 +1595,10 @@ restart: /* Remove the hash link for this page from the hash table */ unlink_hash(keycache, block->hash_link); /* All pending requests for this page must be resubmitted */ +#ifdef THREAD if (block->wqueue[COND_FOR_SAVED].last_thread) release_queue(&block->wqueue[COND_FOR_SAVED]); +#endif } link_to_file_list(keycache, block, file, (my_bool)(block->hash_link ? 1 : 0)); @@ -1669,7 +1678,7 @@ restart: portion is less than read_length, but not less than min_length. */ -static void read_block(KEY_CACHE *keycache, +static void read_block(KEY_CACHE *keycache __attribute__((unused)), BLOCK_LINK *block, uint read_length, uint min_length, my_bool primary) { @@ -1707,8 +1716,10 @@ static void read_block(KEY_CACHE *keycache, KEYCACHE_DBUG_PRINT("read_block", ("primary request: new page in cache")); /* Signal that all pending requests for this page now can be processed */ +#ifdef THREAD if (block->wqueue[COND_FOR_REQUESTED].last_thread) release_queue(&block->wqueue[COND_FOR_REQUESTED]); +#endif } else { @@ -1973,9 +1984,11 @@ int key_cache_insert(KEY_CACHE *keycache, block->length= read_length+offset; KEYCACHE_DBUG_PRINT("key_cache_insert", ("primary request: new page in cache")); +#ifdef THREAD /* Signal that all pending requests for this now can be processed. */ if (block->wqueue[COND_FOR_REQUESTED].last_thread) release_queue(&block->wqueue[COND_FOR_REQUESTED]); +#endif } remove_reader(block); @@ -2219,9 +2232,11 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block) /* Keep track of the number of currently unused blocks. */ keycache->blocks_unused++; +#ifdef THREAD /* All pending requests for this page must be resubmitted. */ if (block->wqueue[COND_FOR_SAVED].last_thread) release_queue(&block->wqueue[COND_FOR_SAVED]); +#endif } @@ -2275,12 +2290,14 @@ static int flush_cached_blocks(KEY_CACHE *keycache, if (!last_errno) last_errno= errno ? errno : -1; } + #ifdef THREAD /* Let to proceed for possible waiting requests to write to the block page. It might happen only during an operation to resize the key cache. */ if (block->wqueue[COND_FOR_SAVED].last_thread) release_queue(&block->wqueue[COND_FOR_SAVED]); +#endif /* type will never be FLUSH_IGNORE_CHANGED here */ if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE)) { diff --git a/mysys/my_error.c b/mysys/my_error.c index d7177e7a047..e60c4eb21d7 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -53,8 +53,10 @@ static struct my_err_head int meh_first; /* error number matching array slot 0 */ int meh_last; /* error number matching last slot */ } my_errmsgs_globerrs = {NULL, globerrs, EE_ERROR_FIRST, EE_ERROR_LAST}; + static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs; + /* Error message to user @@ -76,7 +78,6 @@ int my_error(int nr, myf MyFlags, ...) va_list args; char ebuff[ERRMSGSIZE + 20]; DBUG_ENTER("my_error"); - DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno)); /* Search for the error messages array, which could contain the message. */ @@ -102,6 +103,7 @@ int my_error(int nr, myf MyFlags, ...) DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags)); } + /* Error as printf diff --git a/mysys/my_memmem.c b/mysys/my_memmem.c index 682a1314f09..86916bff860 100644 --- a/mysys/my_memmem.c +++ b/mysys/my_memmem.c @@ -1,4 +1,21 @@ -#include "my_base.h" +/* Copyright (C) 2000 MySQL AB + + 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; either version 2 of the License, or + (at your option) any later version. + + 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 */ + +#include <my_global.h> +#include <m_string.h> /* my_memmem, port of a GNU extension. |