Made workers Genode threads.

This commit is contained in:
Michael Müller
2022-06-30 15:29:13 +02:00
parent dd3bdb3296
commit ee56a3101a

View File

@@ -12,12 +12,13 @@
#include <mx/util/maybe_atomic.h>
#include <variant>
#include <vector>
#include <base/component.h>
namespace mx::tasking {
/**
* The worker executes tasks from his own channel, until the "running" flag is false.
*/
class alignas(64) Worker
class alignas(64) Worker : Genode::Thread
{
public:
Worker(std::uint16_t id, std::uint16_t target_core_id, std::uint16_t target_numa_node_id,
@@ -27,6 +28,12 @@ public:
~Worker() noexcept = default;
/**
* @brief Entry point for Genode thread
*
*/
void entry() override { this->execute(); }
/**
* Starts the worker (typically in its own thread).
*/
@@ -41,6 +48,7 @@ public:
[[nodiscard]] const Channel &channel() const noexcept { return _channel; }
private:
// Id of the logical core.
const std::uint16_t _target_core_id;