MCPcopy Index your code
hub / github.com/F-Stack/f-stack / timeout

Function timeout

lib/ff_kern_timeout.c:628–648  ·  view source on GitHub ↗

* timeout -- * Execute a function after a specified length of time. * * untimeout -- * Cancel previous timeout function call. * * callout_handle_init -- * Initialize a handle so that using it with untimeout is benign. * * See AT&T BCI Driver Reference Manual for specification. This * implementation differs from that one in that although an * identification value is re

Source from the content-addressed store, hash-verified

626 * identify entries for untimeout.
627 */
628struct callout_handle
629timeout(timeout_t *ftn, void *arg, int to_ticks)
630{
631 struct callout_cpu *cc;
632 struct callout *new;
633 struct callout_handle handle;
634
635 cc = CC_CPU(timeout_cpu);
636 CC_LOCK(cc);
637 /* Fill in the next free callout structure. */
638 new = SLIST_FIRST(&cc->cc_callfree);
639 if (new == NULL)
640 /* XXX Attempt to malloc first */
641 panic("timeout table full");
642 SLIST_REMOVE_HEAD(&cc->cc_callfree, c_links.sle);
643 callout_reset(new, to_ticks, ftn, arg);
644 handle.callout = new;
645 CC_UNLOCK(cc);
646
647 return (handle);
648}
649
650void
651untimeout(timeout_t *ftn, void *arg, struct callout_handle handle)

Callers 2

ipf_timer_funcFunction · 0.85
ipfattachFunction · 0.85

Calls 1

panicFunction · 0.70

Tested by

no test coverage detected