[Freeswitch-svn] [commit] r13161 - freeswitch/trunk/src
FreeSWITCH SVN
anthm at freeswitch.org
Mon Apr 27 07:14:42 PDT 2009
Author: anthm
Date: Mon Apr 27 09:14:42 2009
New Revision: 13161
Log:
auto-sync idle timers
Modified:
freeswitch/trunk/src/switch_time.c
Modified: freeswitch/trunk/src/switch_time.c
==============================================================================
--- freeswitch/trunk/src/switch_time.c (original)
+++ freeswitch/trunk/src/switch_time.c Mon Apr 27 09:14:42 2009
@@ -324,7 +324,12 @@
#else
int cond_index = 1;
#endif
+ int delta = (int)(private_info->reference - TIMER_MATRIX[timer->interval].tick);
+ /* sync up timer if it's not been called for a while otherwise it will return instantly several times until it catches up */
+ if (delta < 0) {
+ private_info->reference = timer->tick = TIMER_MATRIX[timer->interval].tick;
+ }
timer_step(timer);
while (globals.RUNNING == 1 && private_info->ready && TIMER_MATRIX[timer->interval].tick < private_info->reference) {
More information about the Freeswitch-svn
mailing list