FS-11379: [freeswitch-core] Rare race condition in state machine #resolve

This commit is contained in:
Anthony Minessale
2018-09-05 17:10:26 -05:00
committed by Mike Jerris
parent b4a64d4817
commit 65524ea2c1
3 changed files with 16 additions and 17 deletions
+1
View File
@@ -1439,6 +1439,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_wake_session_thread(switch_c
} else {
if (switch_channel_state_thread_trylock(session->channel) == SWITCH_STATUS_SUCCESS) {
/* We've beat them for sure, as soon as we release this lock, they will be checking their queue on the next line. */
switch_channel_set_flag(session->channel, CF_STATE_REPEAT);
switch_channel_state_thread_unlock(session->channel);
} else {
/* What luck! The channel has already started going to sleep *after* we checked if we need to wake it up.