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

Function ul_init_timers

modules/usrloc/ul_timer.c:40–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40int ul_init_timers(void)
41{
42 /* cache -> DB timer */
43 if (register_timer("ul-timer", synchronize_all_udomains, 0, timer_interval,
44 TIMER_FLAG_DELAY_ON_DELAY) < 0) {
45 LM_ERR("oom\n");
46 return -1;
47 }
48
49 pending_refreshes = shm_malloc(sizeof *pending_refreshes);
50 if (!pending_refreshes) {
51 LM_ERR("oom\n");
52 return -1;
53 }
54
55 if (!(ul_refresh_lock = lock_alloc())) {
56 LM_ERR("oom\n");
57 return -1;
58 }
59
60 INIT_LIST_HEAD(pending_refreshes);
61 lock_init(ul_refresh_lock);
62
63 /* contact refresh event timer */
64 if (ct_refresh_timer &&
65 register_timer("ul-refresh-timer", trigger_ct_refreshes, 0,
66 1, TIMER_FLAG_SKIP_ON_DELAY) < 0) {
67 LM_ERR("oom\n");
68 return -1;
69 }
70
71 return 0;
72}
73
74
75/*! \brief

Callers 1

mod_initFunction · 0.85

Calls 4

register_timerFunction · 0.85
shm_mallocFunction · 0.85
INIT_LIST_HEADFunction · 0.85
lock_initFunction · 0.85

Tested by

no test coverage detected