mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
added new hook type for asynchronous path
This commit is contained in:
parent
c1e2711ff8
commit
f53d7284d1
2 changed files with 6 additions and 1 deletions
|
@ -54,6 +54,7 @@ enum hook_type {
|
|||
HOOK_PRE, /**< Called when a new packet of messages (samples) was received. */
|
||||
HOOK_POST, /**< Called after each message (sample) of a packet was processed. */
|
||||
HOOK_MSG, /**< Called for each message (sample) in a packet. */
|
||||
HOOK_ASYNC, /**< Called asynchronously with fixed rate (see path::rate). */
|
||||
|
||||
HOOK_PERIODIC, /**< Called periodically. Period is set by global 'stats' option in the configuration file. */
|
||||
|
||||
|
|
|
@ -54,8 +54,12 @@ static void * path_run_async(void *arg)
|
|||
struct path *p = arg;
|
||||
|
||||
/* Block until 1/p->rate seconds elapsed */
|
||||
while (timerfd_wait(p->tfd))
|
||||
while (timerfd_wait(p->tfd)) {
|
||||
if (path_run_hook(p, HOOK_ASYNC))
|
||||
continue;
|
||||
|
||||
path_write(p);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue