[asterisk-commits] russell: branch 1.4 r78028 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 2 21:04:23 CDT 2007


Author: russell
Date: Thu Aug  2 21:04:22 2007
New Revision: 78028

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78028
Log:
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)

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=78028&r1=78027&r2=78028
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Thu Aug  2 21:04:22 2007
@@ -7895,15 +7895,12 @@
 				/* 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);




More information about the asterisk-commits mailing list