µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os-idle.cpp File Reference

Go to the source code of this file.

Functions

void * os_idle (thread::func_args_t args)
 
void os_rtos_idle_actions (void)
 
bool os_rtos_idle_enter_power_saving_mode_hook (void)
 Hook to enter a power saving mode.
 

Function Documentation

◆ os_idle()

void * os_idle ( thread::func_args_t  args)

◆ os_rtos_idle_actions()

void os_rtos_idle_actions ( void  )

Definition at line 63 of file os-idle.cpp.

64{
65 while (!scheduler::terminated_threads_list_.empty ())
66 {
68 {
69 // ----- Enter critical section ---------------------------------------
71 node = const_cast<internal::waiting_thread_node*> (
72 scheduler::terminated_threads_list_.head ());
73 node->unlink ();
74 // ----- Exit critical section ----------------------------------------
75 }
76 node->thread_->internal_destroy_ ();
77
79 }
80
81#if defined(OS_HAS_INTERRUPTS_STACK)
82 // Simple test to verify that the interrupts
83 // did not underflow the stack.
84 assert (rtos::interrupts::stack ()->check_bottom_magic ());
85#endif
86
88 {
89 port::scheduler::wait_for_interrupt ();
90 }
91}
Double linked list node, with thread reference.
Definition os-lists.h:59
rtos::thread * thread_
Pointer to waiting thread.
Definition os-lists.h:107
Interrupts critical section RAII helper.
Definition os-sched.h:502
bool os_rtos_idle_enter_power_saving_mode_hook(void)
Hook to enter a power saving mode.
Definition os-idle.cpp:57
class thread::stack * stack(void)
Get the interrupts stack.
Definition os-core.cpp:583
void yield() noexcept
Yield the CPU to the next ready thread.

References os_rtos_idle_enter_power_saving_mode_hook(), os::rtos::interrupts::stack(), os::rtos::internal::waiting_thread_node::thread_, os::utils::static_double_list_links::unlink(), and this_thread::yield().