MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / insert_timer_unsafe

Function insert_timer_unsafe

modules/tm/timer.c:799–836  ·  view source on GitHub ↗

put a new linker into a timer_list */

Source from the content-addressed store, hash-verified

797
798/* put a new linker into a timer_list */
799static void insert_timer_unsafe( struct timer *timer_list,
800 struct timer_link *tl, utime_t time_out )
801{
802 struct timer_link* ptr;
803
804 tl->time_out = time_out;
805 tl->timer_list = timer_list;
806 tl->deleted = 0;
807
808#ifdef TM_TIMER_DEBUG
809 check_timer_list( timer_list, "before insert" );
810#endif
811 ptr = timer_list->last_tl.prev_tl;
812 for( ; ptr != &timer_list->first_tl ; ptr = ptr->ld_tl->prev_tl) {
813 if ( ptr->time_out<=time_out )
814 break;
815 }
816
817 /* insert "tl" after "ptr" */
818 tl->prev_tl = ptr;
819 tl->next_tl = ptr->next_tl;
820 tl->prev_tl->next_tl = tl;
821 tl->next_tl->prev_tl = tl;
822
823 if (tl->time_out==ptr->time_out) {
824 tl->ld_tl = ptr->ld_tl;
825 ptr->ld_tl = 0;
826 tl->ld_tl->ld_tl = tl;
827 } else {
828 tl->ld_tl = tl;
829 }
830#ifdef TM_TIMER_DEBUG
831 check_timer_list( timer_list, "after insert" );
832#endif
833
834 LM_DBG("[%d]: %p (%lld)\n",timer_list->id,
835 tl,tl->time_out);
836}
837
838
839

Callers 2

set_timerFunction · 0.85
set_1timerFunction · 0.85

Calls 1

check_timer_listFunction · 0.85

Tested by

no test coverage detected