1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

use CLOCK_MONOTONIC

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
Co-authored-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
Steffen Vogel 2022-03-15 12:03:18 -04:00 committed by Steffen Vogel
parent 1520743f73
commit 5daa3e4dca
8 changed files with 15 additions and 13 deletions

View file

@ -372,10 +372,10 @@ int villas::node::ethercat_init(NodeCompat *n) {
w->domain_pd = nullptr;
w->domain_regs = nullptr;
// Placement new for C++ objects
new (&w->send) std::atomic<struct Sample *>();
new (&w->thread) std::thread();
new (&w->task) Task(CLOCK_REALTIME);
/* Placement new for C++ objects */
new (&w->send) std::atomic<struct Sample *>();
new (&w->thread) std::thread();
new (&w->task) Task();
return 0;
}

View file

@ -415,7 +415,9 @@ int villas::node::file_poll_fds(NodeCompat *n, int fds[]) {
int villas::node::file_init(NodeCompat *n) {
auto *f = n->getData<struct file>();
new (&f->task) Task(CLOCK_REALTIME);
// We require a real-time clock here as we can sync against the
// timestamps in the file.
new (&f->task) Task(CLOCK_REALTIME);
// Default values
f->rate = 0;

View file

@ -752,7 +752,7 @@ int villas::node::ngsi_init(NodeCompat *n) {
int ret;
auto *i = n->getData<struct ngsi>();
new (&i->task) Task(CLOCK_REALTIME);
new (&i->task) Task();
ret = list_init(&i->in.signals);
if (ret)

View file

@ -256,9 +256,9 @@ int villas::node::redis_init(NodeCompat *n) {
r->notify = true;
r->rate = 1.0;
new (&r->options) sw::redis::ConnectionOptions;
new (&r->task) Task(CLOCK_REALTIME);
new (&r->key) std::string();
new (&r->options) sw::redis::ConnectionOptions;
new (&r->task) Task();
new (&r->key) std::string();
/* We need a timeout in order for RedisConnection::loop() to properly
* terminate after the node is stopped */

View file

@ -175,7 +175,7 @@ Signal::Ptr SignalNodeSignal::toSignal(Signal::Ptr tpl) const {
}
SignalNode::SignalNode(const uuid_t &id, const std::string &name)
: Node(id, name), task(CLOCK_MONOTONIC), rt(1), rate(10),
: Node(id, name), task(), rt(1), rate(10),
monitor_missed(true), limit(-1), missed_steps(0) {}
int SignalNode::prepare() {

View file

@ -78,7 +78,7 @@ static const char *signal_node_type_str(enum signal_node::SignalType type) {
int villas::node::signal_node_init(NodeCompat *n) {
auto *s = n->getData<struct signal_node>();
new (&s->task) Task(CLOCK_MONOTONIC);
new (&s->task) Task();
s->rt = 1;
s->limit = -1;

View file

@ -137,7 +137,7 @@ int villas::node::stats_node_init(NodeCompat *n) {
int ret;
auto *s = n->getData<struct stats_node>();
new (&s->task) Task(CLOCK_MONOTONIC);
new (&s->task) Task();
ret = list_init(&s->signals);
if (ret)

View file

@ -41,7 +41,7 @@ SuperNode::SuperNode()
#endif
#endif
priority(0), affinity(0), hugepages(DEFAULT_NR_HUGEPAGES), statsRate(1.0),
task(CLOCK_REALTIME), started(time_now()) {
task(), started(time_now()) {
int ret;
char hname[128];