mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fix some issues found by new node-hook test
This commit is contained in:
parent
69212f7cc5
commit
bdca76231b
2 changed files with 16 additions and 16 deletions
19
lib/path.c
19
lib/path.c
|
@ -197,15 +197,6 @@ int path_prepare(struct path *p)
|
|||
|
||||
assert(p->state == STATE_CHECKED);
|
||||
|
||||
#ifdef WITH_HOOKS
|
||||
int m = p->builtin ? HOOK_PATH | HOOK_BUILTIN : 0;
|
||||
|
||||
/* Add internal hooks if they are not already in the list */
|
||||
ret = hook_list_prepare(&p->hooks, &p->signals, m, p, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
#endif /* WITH_HOOKS */
|
||||
|
||||
/* Initialize destinations */
|
||||
struct memory_type *pool_mt = &memory_hugepage;
|
||||
int pool_size = MAX(1, vlist_length(&p->destinations)) * p->queuelen;
|
||||
|
@ -275,6 +266,16 @@ int path_prepare(struct path *p)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_HOOKS
|
||||
int m = p->builtin ? HOOK_PATH | HOOK_BUILTIN : 0;
|
||||
|
||||
/* Add internal hooks if they are not already in the list */
|
||||
ret = hook_list_prepare(&p->hooks, &p->signals, m, p, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
#endif /* WITH_HOOKS */
|
||||
|
||||
/* Initialize pool */
|
||||
ret = pool_init(&p->pool, pool_size, SAMPLE_LENGTH(vlist_length(&p->signals)), pool_mt);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
@ -446,8 +446,8 @@ void SuperNode::stop()
|
|||
if (ret)
|
||||
throw RuntimeError("Failed to stop timer");
|
||||
|
||||
stopPaths();
|
||||
stopNodes();
|
||||
stopPaths();
|
||||
stopNodeTypes();
|
||||
stopInterfaces();
|
||||
|
||||
|
@ -494,7 +494,7 @@ int SuperNode::periodic()
|
|||
started++;
|
||||
|
||||
#ifdef WITH_HOOKS
|
||||
hook_list_periodic(&p->hooks);
|
||||
hook_list_periodic(&p->hooks);
|
||||
#endif /* WITH_HOOKS */
|
||||
}
|
||||
}
|
||||
|
@ -502,13 +502,12 @@ int SuperNode::periodic()
|
|||
for (size_t i = 0; i < vlist_length(&nodes); i++) {
|
||||
auto *n = (struct node *) vlist_at(&nodes, i);
|
||||
|
||||
if (n->state != STATE_STARTED)
|
||||
continue;
|
||||
|
||||
if (n->state == STATE_STARTED) {
|
||||
#ifdef WITH_HOOKS
|
||||
hook_list_periodic(&n->in.hooks);
|
||||
hook_list_periodic(&n->out.hooks);
|
||||
hook_list_periodic(&n->in.hooks);
|
||||
hook_list_periodic(&n->out.hooks);
|
||||
#endif /* WITH_HOOKS */
|
||||
}
|
||||
}
|
||||
|
||||
if (idleStop && state == STATE_STARTED && started == 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue