From: Andrey Volk Date: Fri, 16 Apr 2021 22:06:21 +0000 (+0300) Subject: [Core] Fix wrong lock order in switch_user_sql_thread() X-Git-Tag: v1.10.7^2~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69b8c080f69821d9a0a3359d167a9bf81c57caba;p=thirdparty%2Ffreeswitch.git [Core] Fix wrong lock order in switch_user_sql_thread() --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 38bfa9448f..8d9eaf152c 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -2287,10 +2287,11 @@ static void *SWITCH_THREAD_FUNC switch_user_sql_thread(switch_thread_t *thread, switch_mutex_lock(qm->cond2_mutex); if (qm->skip_wait > 0) { qm->skip_wait--; + switch_mutex_unlock(qm->cond2_mutex); } else { + switch_mutex_unlock(qm->cond2_mutex); switch_thread_cond_wait(qm->cond, qm->cond_mutex); } - switch_mutex_unlock(qm->cond2_mutex); } i = 40;