Skip to content

Commit

Permalink
[Core] Fix wrong lock order in switch_user_sql_thread()
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Oct 23, 2021
1 parent 79127d9 commit 69b8c08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/switch_core_sqldb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit 69b8c08

@andywolk
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.