From 1df8c338a4351c49be789ebbf4af7d7647e58dea Mon Sep 17 00:00:00 2001 From: Arsen Chaloyan Date: Mon, 20 Aug 2007 12:44:13 +0000 Subject: [PATCH] mutex must be locked before channel_add call git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5619 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c index be3441ea81..53d3f8fec4 100644 --- a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c +++ b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c @@ -331,9 +331,8 @@ static switch_status_t openmrcp_asr_open(switch_asr_handle_t *ah, char *codec, i return SWITCH_STATUS_FALSE; } - mrcp_client_context_channel_add(asr_session->profile->mrcp_context, asr_session->client_session, asr_channel, NULL); - switch_mutex_lock(asr_session->flag_mutex); + mrcp_client_context_channel_add(asr_session->profile->mrcp_context, asr_session->client_session, asr_channel, NULL); if(switch_thread_cond_timedwait(asr_session->wait_object,asr_session->flag_mutex,5000*1000) != APR_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n"); } @@ -577,9 +576,8 @@ static switch_status_t openmrcp_tts_open(switch_speech_handle_t *sh, char *voice switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create synthesizer channel\n"); return SWITCH_STATUS_FALSE; } - mrcp_client_context_channel_add(tts_session->profile->mrcp_context, tts_session->client_session, tts_channel, NULL); - switch_mutex_lock(tts_session->flag_mutex); + mrcp_client_context_channel_add(tts_session->profile->mrcp_context, tts_session->client_session, tts_channel, NULL); if(switch_thread_cond_timedwait(tts_session->wait_object,tts_session->flag_mutex,5000*1000) != APR_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n"); }