diff options
author | monty@hundin.mysql.fi <> | 2002-07-01 11:19:17 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2002-07-01 11:19:17 +0300 |
commit | 6cb77c6b3e706e8e7cf9de0150e53e1a6b3b1a86 (patch) | |
tree | 66404d97e9968903635aeaf96095c74808573c78 /mysys/mf_iocache.c | |
parent | daaf9b1a3145faf47d3e67f9d6c3188455d55cbb (diff) | |
download | mariadb-git-6cb77c6b3e706e8e7cf9de0150e53e1a6b3b1a86.tar.gz |
Portability fixes.
Don't free memory from InnoDB at exit (as this may be done before other threads are finnished)
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r-- | mysys/mf_iocache.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 54513ba73de..f5e381cf026 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -468,9 +468,11 @@ static int lock_io_cache(IO_CACHE *info) very beginning, that is returns 1 and does not unlock the mutex. */ if (++(info->share->count)) - return pthread_mutex_unlock(&info->share->mutex); - else - return 1; + { + pthread_mutex_unlock(&info->share->mutex); + return 0; + } + return 1; } static void unlock_io_cache(IO_CACHE *info) @@ -479,6 +481,7 @@ static void unlock_io_cache(IO_CACHE *info) pthread_mutex_unlock(&info->share->mutex); } + /* Read from IO_CACHE when it is shared between several threads. It works as follows: when a thread tries to read from a file @@ -488,6 +491,7 @@ static void unlock_io_cache(IO_CACHE *info) returns 1, the thread does actual IO and unlock_io_cache(), which signals all the waiting threads that data is in the buffer. */ + int _my_b_read_r(register IO_CACHE *info, byte *Buffer, uint Count) { my_off_t pos_in_file; @@ -1068,8 +1072,9 @@ int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock) if ((length=(uint) (info->write_pos - info->write_buffer))) { pos_in_file=info->pos_in_file; - /* if we have append cache, we always open the file with - O_APPEND which moves the pos to EOF automatically on every write + /* + If we have append cache, we always open the file with + O_APPEND which moves the pos to EOF automatically on every write */ if (!append_cache && info->seek_not_done) { /* File touched, do seek */ |