From: Russell Bryant Date: Fri, 3 Aug 2007 02:05:02 +0000 (+0000) Subject: Merged revisions 78028 via svnmerge from X-Git-Tag: 1.6.0-beta1~3^2~1815 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcabfbb89ade46abd186c74a377ba6fab95d2a47;p=thirdparty%2Fasterisk.git Merged revisions 78028 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78028 | russell | 2007-08-02 21:04:22 -0500 (Thu, 02 Aug 2007) | 6 lines Don't reuse the timespec that was set to 0 in the previous timedwait as it will just return immediately. Also, fix some logic so the thread's lock isn't unlocked twice in the weird case of dynamic threads getting acquired right after a timeout. (pointed out by SteveK) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78029 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 72bf28f73f..8b21c79b10 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -8413,15 +8413,12 @@ static void *iax2_process_thread(void *data) /* Someone grabbed our thread *right* after we timed out. * Wait for them to set us up with something to do and signal * us to continue. */ - ast_cond_timedwait(&thread->cond, &thread->lock, &ts); - ast_mutex_unlock(&thread->lock); + ast_cond_wait(&thread->cond, &thread->lock); } - if (!t) - ast_mutex_unlock(&thread->lock); } else { ast_cond_wait(&thread->cond, &thread->lock); - ast_mutex_unlock(&thread->lock); } + ast_mutex_unlock(&thread->lock); /* Add ourselves to the active list now */ AST_LIST_LOCK(&active_list);