[asterisk-commits] trunk r14573 - /trunk/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 23 16:57:18 MST 2006


Author: kpfleming
Date: Thu Mar 23 17:57:18 2006
New Revision: 14573

URL: http://svn.digium.com/view/asterisk?rev=14573&view=rev
Log:
compute scheduler thread timeout properly

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=14573&r1=14572&r2=14573&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu Mar 23 17:57:18 2006
@@ -8264,13 +8264,16 @@
 {
 	int count;
 	int res;
+	struct timeval tv;
 	struct timespec ts;
 
 	for (;;) {
 		res = ast_sched_wait(sched);
 		if ((res > 1000) || (res < 0))
 			res = 1000;
-		ts.tv_sec = res;
+		tv = ast_tvadd(ast_tvnow(), ast_samp2tv(res, 1000));
+		ts.tv_sec = tv.tv_sec;
+		ts.tv_nsec = tv.tv_usec * 1000;
 
 		ast_mutex_lock(&sched_lock);
 		ast_cond_timedwait(&sched_cond, &sched_lock, &ts);



More information about the asterisk-commits mailing list