MCPcopy Create free account
hub / github.com/apache/trafficserver / tmr_run

Function tmr_run

tools/http_load/timers.c:213–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void
214tmr_run(struct timeval *nowP)
215{
216 int h;
217 Timer *t;
218 Timer *next;
219
220 for (h = 0; h < HASH_SIZE; ++h)
221 for (t = timers[h]; t != (Timer *)0; t = next) {
222 next = t->next;
223 /* Since the lists are sorted, as soon as we find a timer
224 ** that isn't ready yet, we can go on to the next list.
225 */
226 if (t->time.tv_sec > nowP->tv_sec || (t->time.tv_sec == nowP->tv_sec && t->time.tv_usec > nowP->tv_usec))
227 break;
228
229 /* Invalidate mstimeout cache, since we're modifying the queue */
230 mstimeout_cache = -1;
231
232 (t->timer_proc)(t->client_data, nowP);
233 if (t->periodic) {
234 /* Reschedule. */
235 t->time.tv_sec += t->msecs / 1000L;
236 t->time.tv_usec += (t->msecs % 1000L) * 1000L;
237 if (t->time.tv_usec >= 1000000L) {
238 t->time.tv_sec += t->time.tv_usec / 1000000L;
239 t->time.tv_usec %= 1000000L;
240 }
241 l_resort(t);
242 } else
243 tmr_cancel(t);
244 }
245}
246
247void
248tmr_reset(struct timeval *nowP, Timer *t)

Callers 2

mainFunction · 0.85
start_connectionFunction · 0.85

Calls 2

l_resortFunction · 0.85
tmr_cancelFunction · 0.85

Tested by

no test coverage detected