MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_level

Function add_level

ccan/ccan/timer/timer.c:165–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static void add_level(struct timers *timers, unsigned int level)
166{
167 struct timer_level *l;
168 struct timer *t;
169 unsigned int i;
170 struct list_head from_far;
171
172 l = timer_alloc(timers, sizeof(*l));
173 if (!l)
174 return;
175
176 for (i = 0; i < ARRAY_SIZE(l->list); i++)
177 list_head_init(&l->list[i]);
178 timers->level[level] = l;
179
180 list_head_init(&from_far);
181 timers_far_get(timers, &from_far, level_max_time(timers, level));
182
183 while ((t = list_pop(&from_far, struct timer, list)) != NULL)
184 timer_add_raw(timers, t);
185}
186
187/* We don't need to search past the first at level 0, since the
188 * bucket range is 1; they're all the same. */

Callers 3

timer_fast_forwardFunction · 0.85
timers_expireFunction · 0.85
mainFunction · 0.85

Calls 4

list_head_initFunction · 0.85
timers_far_getFunction · 0.85
level_max_timeFunction · 0.85
timer_add_rawFunction · 0.85

Tested by 1

mainFunction · 0.68