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:
Gleb Smirnoff 2005-05-13 11:35:02 +00:00
parent 34ddec12b1
commit aacdb11479
2 changed files with 18 additions and 3 deletions

View File

@ -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);

View File

@ -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));
}
/*