git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16477 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2010-01-23 06:53:30 +00:00
1 parent a9f33bc1a6
commit 25a4270e3d
3 files changed
+39 -9

No files matched your search

+9 -3
View File
@@ -985,10 +985,16 @@ SWITCH_DECLARE(switch_channel_t *) switch_core_session_get_channel(switch_core_s
SWITCH_DECLARE(void) switch_core_session_wake_session_thread(switch_core_session_t *session)
{
int x = 5;
/* If trylock fails the signal is already awake so we needn't bother */
if (switch_mutex_trylock(session->mutex) == SWITCH_STATUS_SUCCESS) {
switch_thread_cond_signal(session->cond);
switch_mutex_unlock(session->mutex);
for(;;) {
if (switch_mutex_trylock(session->mutex) == SWITCH_STATUS_SUCCESS) {
switch_thread_cond_signal(session->cond);
switch_mutex_unlock(session->mutex);
return;
}
if (!--x) return;
switch_yield(1000);
}
}