From 473c97cfb646cb7af46468c58a657de15e86e64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 5 Jul 2022 15:39:09 +0200 Subject: [PATCH] Use Genode's Timer::u_sleep() to put EpochManager to sleep. --- src/mx/memory/reclamation/epoch_manager.cpp | 4 +--- src/mx/memory/reclamation/epoch_manager.h | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/mx/memory/reclamation/epoch_manager.cpp b/src/mx/memory/reclamation/epoch_manager.cpp index 5270a5c..c9a51a8 100644 --- a/src/mx/memory/reclamation/epoch_manager.cpp +++ b/src/mx/memory/reclamation/epoch_manager.cpp @@ -5,7 +5,6 @@ using namespace mx::memory::reclamation; -/* TODO: Find out wether timeouts can be delievered to single threads, or only globally per component */ void EpochManager::enter_epoch_periodically() { // Wait until the scheduler starts the system. @@ -40,9 +39,8 @@ void EpochManager::enter_epoch_periodically() } // Wait some time until next epoch. - // TODO: Use native Genode method //std::this_thread::sleep_for(config::epoch_interval()); // NOLINT: sleep_for seems to crash clang-tidy - _timer.trigger_once(config::epoch_interval().count()); + _timer.u_sleep(config::epoch_interval().count()); } } diff --git a/src/mx/memory/reclamation/epoch_manager.h b/src/mx/memory/reclamation/epoch_manager.h index aba4955..110d05a 100644 --- a/src/mx/memory/reclamation/epoch_manager.h +++ b/src/mx/memory/reclamation/epoch_manager.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -155,7 +156,7 @@ private: std::atomic _global_epoch{0U}; // Genode Timer object, needed for waking up periodically - Genode::Timer::Connection _timer { system::environment.env; } + Timer::Connection _timer { /* TODO: Get environment for Genode */ }; // Local epochs, one for every channel. alignas(64) std::array _local_epochs; @@ -173,11 +174,6 @@ private: */ void reclaim_epoch_garbage() noexcept; - /** - * @brief Timeout handler for Genode - * - */ - void _handle_period(); }; class ReclaimEpochGarbageTask final : public tasking::TaskInterface