Use Genode's Timer::u_sleep() to put EpochManager to sleep.

This commit is contained in:
Michael Müller
2022-07-05 15:39:09 +02:00
parent 683b557a58
commit 473c97cfb6
2 changed files with 3 additions and 9 deletions

View File

@@ -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());
}
}

View File

@@ -6,6 +6,7 @@
#include <chrono>
#include <cstdint>
#include <base/component.h>
#include <timer_session/connection.h>
#include <mx/memory/config.h>
#include <mx/memory/dynamic_size_allocator.h>
#include <mx/resource/resource_interface.h>
@@ -155,7 +156,7 @@ private:
std::atomic<epoch_t> _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<LocalEpoch, tasking::config::max_cores()> _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