]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix wrong lock order in switch_user_sql_thread()
authorAndrey Volk <andywolk@gmail.com>
Fri, 16 Apr 2021 22:06:21 +0000 (01:06 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:43 +0000 (22:00 +0300)
src/switch_core_sqldb.c

index 38bfa9448f3d9af40d8630325175c5e3a761324d..8d9eaf152cd0ee7044d6450fe65d1d93cc037f04 100644 (file)
@@ -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;