Handout
This commit is contained in:
27
thread/idlethread.h
Normal file
27
thread/idlethread.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*! \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:
|
||||
/*! \brief Wait for a thread to become ready and sleep in the meantime.
|
||||
*
|
||||
* \todo(16) Implement Method
|
||||
*/
|
||||
void action() override;
|
||||
};
|
||||
Reference in New Issue
Block a user