MDEV-26558 Fix a deadlock due to cyclic dependence

Fix a potential deadlock bug between locks ctrl_mutex and entry->mutex
This commit is contained in:
ryancaicse 2021-11-10 18:35:17 +08:00 committed by Robert Bindar
parent ef179dadf4
commit f809a4fbd0

View file

@ -443,8 +443,8 @@ extract_worker_thread_func(void *arg)
}
if (chunk.type == XB_CHUNK_TYPE_EOF) {
pthread_mutex_lock(ctxt->mutex);
pthread_mutex_unlock(&entry->mutex);
pthread_mutex_lock(ctxt->mutex);
my_hash_delete(ctxt->filehash, (uchar *) entry);
pthread_mutex_unlock(ctxt->mutex);