From 9bcb03d06c307b42f00039f6e7432ccc976fc95d Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 31 Oct 2024 12:33:46 +0100 Subject: [PATCH] fix: Default clock for tasks to be monotonic Signed-off-by: Steffen Vogel --- common/include/villas/task.hpp | 6 +++--- include/villas/nodes/test_rtt.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/include/villas/task.hpp b/common/include/villas/task.hpp index 3ef65461e..8bd030ba7 100644 --- a/common/include/villas/task.hpp +++ b/common/include/villas/task.hpp @@ -49,14 +49,14 @@ struct Task { #endif // Create a new task with the given rate. - Task(int clock = CLOCK_REALTIME); + Task(int clock = CLOCK_MONOTONIC); ~Task(); // Wait until task elapsed // - // @retval 0 An error occured. Maybe the task was stopped. - // @retval >0 The nummer of runs this task already fired. + // @retval 0 An error occurred. Maybe the task was stopped. + // @retval >0 The number of runs this task already fired. uint64_t wait(); void setNext(const struct timespec *next); diff --git a/include/villas/nodes/test_rtt.hpp b/include/villas/nodes/test_rtt.hpp index c33db2d8c..cb0dfe2d1 100644 --- a/include/villas/nodes/test_rtt.hpp +++ b/include/villas/nodes/test_rtt.hpp @@ -93,8 +93,8 @@ public: }; TestRTT(const uuid_t &id = {}, const std::string &name = "") - : Node(id, name), task(CLOCK_MONOTONIC), formatter(nullptr), - stream(nullptr), shutdown(false) {} + : Node(id, name), task(), formatter(nullptr), stream(nullptr), + shutdown(false) {} virtual ~TestRTT(){};