mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-15 22:08:33 +00:00
Wed Jan 28 12:09:00 CST 2009 Pekka Pessi <first.last@nokia.com>
* su_port.h, su_timer.c: refactored su_timer_next_expires() git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11855 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
314d3883dd
commit
f26dd3daf8
4 files changed
+14
-17
No files matched your search
@@ -166,7 +166,7 @@ SOFIAPUBFUN su_port_t *su_port_create(void)
|
||||
/* Extension from >= 1.12.5 */
|
||||
|
||||
SOFIAPUBFUN void su_msg_delivery_report(su_msg_r msg);
|
||||
SOFIAPUBFUN su_duration_t su_timer_next_expires(su_timer_t const * t,
|
||||
SOFIAPUBFUN su_duration_t su_timer_next_expires(su_timer_queue_t const *timers,
|
||||
su_time_t now);
|
||||
SOFIAPUBFUN su_root_t *su_root_create_with_port(su_root_magic_t *magic,
|
||||
su_port_t *port)
|
||||
|
||||
@@ -581,25 +581,22 @@ int su_timer_expire(su_timer_queue_t * const timers,
|
||||
|
||||
|
||||
/** Calculate duration in milliseconds until next timer expires. */
|
||||
su_duration_t su_timer_next_expires(su_timer_t const * t, su_time_t now)
|
||||
su_duration_t su_timer_next_expires(su_timer_queue_t const *timers,
|
||||
su_time_t now)
|
||||
{
|
||||
su_timer_queue_t *timers;
|
||||
su_duration_t next = SU_DURATION_MAX;
|
||||
|
||||
su_duration_t tout;
|
||||
su_timer_t const *t;
|
||||
|
||||
if (!t)
|
||||
return SU_DURATION_MAX;
|
||||
t = timers ? timers_get(timers[0], 1) : NULL;
|
||||
|
||||
timers = su_task_timers(t->sut_task);
|
||||
if (t) {
|
||||
next = su_duration(t->sut_when, now);
|
||||
if (next < 0)
|
||||
next = 0;
|
||||
}
|
||||
|
||||
t = timers ? timers_get(timers[0], 1) : NULL;
|
||||
|
||||
if (!t)
|
||||
return SU_DURATION_MAX;
|
||||
|
||||
tout = su_duration(t->sut_when, now);
|
||||
|
||||
return tout > 0 ? tout : 0 ;
|
||||
return next;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user