mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
auto-sync idle timers
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13161 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b27dbfd24c
commit
6cdb09ddb5
@ -324,7 +324,12 @@ static switch_status_t timer_next(switch_timer_t *timer)
|
|||||||
#else
|
#else
|
||||||
int cond_index = 1;
|
int cond_index = 1;
|
||||||
#endif
|
#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);
|
timer_step(timer);
|
||||||
|
|
||||||
while (globals.RUNNING == 1 && private_info->ready && TIMER_MATRIX[timer->interval].tick < private_info->reference) {
|
while (globals.RUNNING == 1 && private_info->ready && TIMER_MATRIX[timer->interval].tick < private_info->reference) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user