MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_callout

Function ng_callout

lib/ff_ng_base.c:3815–3839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3813}
3814
3815int
3816ng_callout(struct callout *c, node_p node, hook_p hook, int ticks,
3817 ng_item_fn *fn, void * arg1, int arg2)
3818{
3819 item_p item, oitem;
3820
3821 if ((item = ng_alloc_item(NGQF_FN, NG_NOFLAGS)) == NULL)
3822 return (ENOMEM);
3823
3824 item->el_flags |= NGQF_WRITER;
3825 NG_NODE_REF(node); /* and one for the item */
3826 NGI_SET_NODE(item, node);
3827 if (hook) {
3828 NG_HOOK_REF(hook);
3829 NGI_SET_HOOK(item, hook);
3830 }
3831 NGI_FN(item) = fn;
3832 NGI_ARG1(item) = arg1;
3833 NGI_ARG2(item) = arg2;
3834 oitem = c->c_arg;
3835 if (callout_reset(c, ticks, &ng_callout_trampoline, item) == 1 &&
3836 oitem != NULL)
3837 NG_FREE_ITEM(oitem);
3838 return (0);
3839}
3840
3841/* A special modified version of callout_stop() */
3842int

Callers

nothing calls this directly

Calls 1

ng_alloc_itemFunction · 0.70

Tested by

no test coverage detected