You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			28 lines
		
	
	
		
			785 B
		
	
	
	
		
			C++
		
	
			
		
		
	
	
			28 lines
		
	
	
		
			785 B
		
	
	
	
		
			C++
		
	
| /*! \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;
 | |
| };
 |