Since there is no way to queue a function call to node, create
ng_queue_fn() - a queue version of ng_send_fn().
This commit is contained in:
parent
34ddec12b1
commit
aacdb11479
@ -1077,6 +1077,8 @@ int ng_rmtype(struct ng_type *tp);
|
||||
int ng_snd_item(item_p item, int queue);
|
||||
int ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn,
|
||||
void *arg1, int arg2);
|
||||
int ng_queue_fn(node_p node, hook_p hook, ng_item_fn *fn,
|
||||
void *arg1, int arg2);
|
||||
int ng_uncallout(struct callout *c, node_p node);
|
||||
int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks,
|
||||
ng_item_fn *fn, void * arg1, int arg2);
|
||||
|
@ -3568,8 +3568,9 @@ ng_package_msg_self(node_p here, hook_p hook, struct ng_mesg *msg)
|
||||
return (item);
|
||||
}
|
||||
|
||||
int
|
||||
ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
||||
static __inline int
|
||||
ng_send_fn1(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2,
|
||||
int queue)
|
||||
{
|
||||
item_p item;
|
||||
|
||||
@ -3586,7 +3587,19 @@ ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
||||
NGI_FN(item) = fn;
|
||||
NGI_ARG1(item) = arg1;
|
||||
NGI_ARG2(item) = arg2;
|
||||
return(ng_snd_item(item, 0));
|
||||
return(ng_snd_item(item, queue));
|
||||
}
|
||||
|
||||
int
|
||||
ng_send_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
||||
{
|
||||
return (ng_send_fn1(node, hook, fn, arg1, arg2, 0));
|
||||
}
|
||||
|
||||
int
|
||||
ng_queue_fn(node_p node, hook_p hook, ng_item_fn *fn, void * arg1, int arg2)
|
||||
{
|
||||
return (ng_send_fn1(node, hook, fn, arg1, arg2, 1));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user