summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache.c
diff options
context:
space:
mode:
authorserg@serg.mylan <>2004-03-25 11:22:01 +0100
committerserg@serg.mylan <>2004-03-25 11:22:01 +0100
commitd8a9a8267bfb0e759a5fcda1cb2f3beba6c3c7ca (patch)
tree9fcb276a7665d2280d76dfc889316c975f1956c1 /mysys/mf_iocache.c
parent97091f38fe61413d2d1af060d3bf0f6d0ac76818 (diff)
downloadmariadb-git-d8a9a8267bfb0e759a5fcda1cb2f3beba6c3c7ca.tar.gz
shared IO_CACHE: protection against remove_io_share in a wrong time
bug#3134
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r--mysys/mf_iocache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index c5bd7db9677..8fb93dc4780 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -481,7 +481,8 @@ static int lock_io_cache(IO_CACHE *info, my_off_t pos)
while (!s->active || s->active->pos_in_file < pos)
pthread_cond_wait(&s->cond, &s->mutex);
- if (s->total < total)
+ if (s->total < total &&
+ (!s->active || s->active->pos_in_file < pos))
return 1;
pthread_mutex_unlock(&s->mutex);