summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-01 10:38:16 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-01 10:38:16 +0300
commit9591abbd399bb4b85db9da458fba5ed972c97afa (patch)
treec8989889543a2c502ec6a75d58738675ffac837c /mysys
parent4295917682a23b6f8d493d9433b0b7c1f244c421 (diff)
downloadmariadb-git-9591abbd399bb4b85db9da458fba5ed972c97afa.tar.gz
Make killing of threads safer
Docs/manual.texi: Changelog sql/sql_insert.cc: Fix problem with INSERT DELAYED during shutdown
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_lock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 841c2f1bb91..d2b3960d6b5 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -374,16 +374,16 @@ static my_bool wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
}
/* Set up control struct to allow others to abort locks */
- pthread_mutex_lock(&thread_var->mutex);
thread_var->current_mutex= &data->lock->mutex;
thread_var->current_cond= cond;
- pthread_mutex_unlock(&thread_var->mutex);
data->cond=cond;
- do
+ while (!thread_var->abort || in_wait_list)
{
pthread_cond_wait(cond,&data->lock->mutex);
- } while (data->cond == cond && (!thread_var->abort || in_wait_list));
+ if (data->cond != cond)
+ break;
+ }
if (data->cond || data->type == TL_UNLOCK)
{