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

Function remove_timer_unsafe

modules/tm/timer.c:759–795  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757
758
759static void remove_timer_unsafe( struct timer_link* tl )
760{
761#ifdef EXTRA_DEBUG
762 if (tl && is_in_timer_list2(tl) &&
763 tl->timer_list->last_tl.prev_tl==0) {
764 LM_CRIT("Oh no, zero link in trailing timer element\n");
765 abort();
766 };
767#endif
768 if (is_in_timer_list2( tl )) {
769#ifdef EXTRA_DEBUG
770 LM_DBG("unlinking timer: tl=%p, timeout=%lld, group=%d\n",
771 tl, tl->time_out, tl->tg);
772#endif
773#ifdef TM_TIMER_DEBUG
774 check_timer_list( tl->timer_list, "before remove" );
775#endif
776 if (tl->ld_tl && tl->ld_tl!=tl) {
777 if (tl->time_out==tl->prev_tl->time_out) {
778 tl->prev_tl->ld_tl = tl->ld_tl;
779 tl->ld_tl->ld_tl = tl->prev_tl;
780 } else {
781 tl->next_tl->ld_tl = tl->ld_tl;
782 tl->ld_tl->ld_tl = tl->next_tl;
783 }
784 }
785 tl->prev_tl->next_tl = tl->next_tl;
786 tl->next_tl->prev_tl = tl->prev_tl;
787#ifdef TM_TIMER_DEBUG
788 check_timer_list( tl->timer_list, "after remove" );
789#endif
790 tl->next_tl = 0;
791 tl->prev_tl = 0;
792 tl->ld_tl = 0;
793 tl->timer_list = NULL;
794 }
795}
796
797
798/* put a new linker into a timer_list */

Callers 2

set_timerFunction · 0.85
unlink_timersFunction · 0.85

Calls 1

check_timer_listFunction · 0.85

Tested by

no test coverage detected