mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixed invalid pool_current() pool_previous() pointers for the hook functions
This commit is contained in:
parent
50d048e017
commit
6923e57b63
2 changed files with 5 additions and 5 deletions
|
@ -17,10 +17,10 @@
|
|||
#define pool_end(pool) pool_get(pool, pool->lenght)
|
||||
|
||||
/** Return pointer to last element which has been inserted. */
|
||||
#define pool_current(pool) pool_getrel(pool, 0)
|
||||
#define pool_current(pool) pool_getrel(pool, -1)
|
||||
|
||||
/** Return pointer to the element before the previously added one. */
|
||||
#define pool_previous(pool) pool_getrel(pool, -1)
|
||||
#define pool_previous(pool) pool_getrel(pool, -2)
|
||||
|
||||
/** Iterate through the circuluar buffer. */
|
||||
#define pool_foreach(ptr, pool, start, end) for (int _i = start, _p; _p = 1, _i < end; _i++) \
|
||||
|
|
|
@ -89,9 +89,6 @@ static void * path_run(void *arg)
|
|||
error("Failed to receive message from node %s", node_name(p->in));
|
||||
else if (recv == 0)
|
||||
continue;
|
||||
|
||||
/* Update tail pointer of message pool by the amount of actually received messages. */
|
||||
pool_push(&p->pool, recv);
|
||||
|
||||
/** @todo Replace this timestamp by hardware timestamping for node type which support it. */
|
||||
p->ts.last = p->ts.recv;
|
||||
|
@ -107,6 +104,9 @@ static void * path_run(void *arg)
|
|||
|
||||
/* For each received message... */
|
||||
for (int i = 0; i < recv; i++) {
|
||||
/* Update tail pointer of message pool by the amount of actually received messages. */
|
||||
pool_push(&p->pool, 1);
|
||||
|
||||
p->received++;
|
||||
|
||||
/* Run hooks for filtering, stats collection and manipulation */
|
||||
|
|
Loading…
Add table
Reference in a new issue