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

Function new_os_timer

timer.c:220–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220static inline struct os_timer* new_os_timer(char *label, unsigned short flags,
221 timer_function f, void* param, unsigned int interval)
222{
223 struct os_timer* t;
224
225 if (label==NULL)
226 label = "n/a";
227
228 t=shm_malloc( sizeof(struct os_timer) + strlen(label)+1 );
229 if (t==0){
230 LM_ERR("out of pkg memory\n");
231 return NULL;
232 }
233 t->id=timer_id++;
234 t->flags = flags;
235 t->label = (char*)(t+1);
236 strcpy( t->label, label);
237 t->u.timer_f=f;
238 t->t_param=param;
239 t->interval=interval;
240 t->expires=*jiffies+interval;
241 t->trigger_time = 0;
242 t->time = 0;
243 return t;
244}
245
246
247/*register a periodic timer;

Callers 3

register_timerFunction · 0.85
register_utimerFunction · 0.85
register_route_timersFunction · 0.85

Calls 1

shm_mallocFunction · 0.85

Tested by

no test coverage detected