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

Function timer_routine

modules/tm/timer.c:1098–1133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1096
1097
1098void timer_routine(unsigned int ticks , void *set)
1099{
1100 struct timer_link *tl, *tmp_tl;
1101 struct timespec begin;
1102 int id;
1103
1104 clock_gettime(CLOCK_REALTIME, &begin);
1105
1106 lock_get( timertable[(long)set].ex_lock );
1107
1108 for( id=0 ; id<RT_T1_TO_1 ; id++ )
1109 {
1110 /* to waste as little time in lock as possible, detach list
1111 with expired items and process them after leaving the lock */
1112 tl=check_and_split_time_list( &timertable[(long)set].timers[ id ], ticks);
1113 /* process items now */
1114 switch (id)
1115 {
1116 case FR_TIMER_LIST:
1117 case FR_INV_TIMER_LIST:
1118 run_handler_for_each(tl,final_response_handler);
1119 break;
1120 case WT_TIMER_LIST:
1121 run_handler_for_each(tl,wait_handler);
1122 break;
1123 case DELETE_LIST:
1124 run_handler_for_each(tl,delete_handler);
1125 break;
1126 }
1127 }
1128 lock_release( timertable[(long)set].ex_lock );
1129
1130 clock_check_diff((double)TM_TIMER_ITV_S*1e9 * TM_TIMER_LOAD_WARN,
1131 "now at %d%%+ capacity, inuse_transactions: %lu", (int)(TM_TIMER_LOAD_WARN*100),
1132 (unsigned long)get_stat_val(tm_trans_inuse));
1133}
1134
1135
1136

Callers

nothing calls this directly

Calls 3

lock_getFunction · 0.85
lock_releaseFunction · 0.85

Tested by

no test coverage detected