This commit is contained in:
Niklas Gollenstede
2025-10-31 22:37:36 +01:00
commit 174fe17e89
197 changed files with 79558 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/*! \file
* \brief \ref IdleThread executed by the \ref Scheduler if no other \ref
* Thread is ready
*/
#pragma once
#include "../types.h"
#include "thread.h"
/*! \brief Thread that is executed when there is nothing to do for this core.
* \ingroup thread
*
* Using the IdleThread simplifies the idea of waiting and is an answer to the
* questions that arise once the ready queue is empty.
*
* \note Instance of this class should *never* be inserted into the scheduler's
* ready queue, as the IdleThread should only be executed if there is no
* proper work to do.
*/
class IdleThread : public Thread {
public:
explicit IdleThread() : Thread() {}
/*! \brief Wait for a thread to become ready and sleep in the meantime.
*
*/
void action() override;
};