mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
path: path_poll_prepare is not possible before nodes are started
This commit is contained in:
parent
db15dda566
commit
d7f9f7218f
1 changed files with 15 additions and 9 deletions
24
lib/path.cpp
24
lib/path.cpp
|
@ -148,6 +148,9 @@ int path_init(struct path *p)
|
|||
|
||||
p->_name = nullptr;
|
||||
|
||||
p->reader.pfds = nullptr;
|
||||
p->reader.nfds = 0;
|
||||
|
||||
/* Default values */
|
||||
p->mode = PathMode::ANY;
|
||||
p->rate = 0; /* Disabled */
|
||||
|
@ -168,6 +171,9 @@ static int path_prepare_poll(struct path *p)
|
|||
{
|
||||
int fds[16], ret, n = 0, m;
|
||||
|
||||
if (p->reader.pfds)
|
||||
free(p->reader.pfds);
|
||||
|
||||
p->reader.pfds = nullptr;
|
||||
p->reader.nfds = 0;
|
||||
|
||||
|
@ -297,13 +303,6 @@ int path_prepare(struct path *p)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Prepare poll() */
|
||||
if (p->poll) {
|
||||
ret = path_prepare_poll(p);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (p->original_sequence_no == -1)
|
||||
p->original_sequence_no = vlist_length(&p->sources) == 1;
|
||||
|
||||
|
@ -628,6 +627,15 @@ int path_start(struct path *p)
|
|||
p->last_sample->data[i] = sig->init;
|
||||
}
|
||||
|
||||
/* Prepare poll() */
|
||||
if (p->poll) {
|
||||
ret = path_prepare_poll(p);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
p->state = State::STARTED;
|
||||
|
||||
/* Start one thread per path for sending to destinations
|
||||
*
|
||||
* Special case: If the path only has a single source and this source
|
||||
|
@ -638,8 +646,6 @@ int path_start(struct path *p)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
p->state = State::STARTED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue