µOS++ IIIe / CMSIS++ / POSIX++ Reference  v6.3.11
“Perfekt ist nicht gut genug”
The third edition of µOS++ and CMSIS++, a proposal for the next generation CMSIS, written in C++.
os::rtos::port::scheduler Namespace Reference

Functions

void _wait_for_interrupt (void)
 
void greeting (void)
 
result_t initialize (void)
 Initialise the RTOS scheduler. More...
 
port::scheduler::state_t lock (void)
 Lock the scheduler. More...
 
port::scheduler::state_t locked (port::scheduler::state_t state)
 Lock/unlock the scheduler. More...
 
bool locked (void)
 Check if the scheduler is locked. More...
 
bool preemptive (void)
 Check if the scheduler is in preemptive mode. More...
 
bool preemptive (bool)
 Set the scheduler preemptive mode. More...
 
void reschedule (void)
 
void start (void)
 Start the RTOS scheduler. More...
 
stack::element_t * switch_stacks (stack::element_t *sp)
 
port::scheduler::state_t unlock (void)
 Unlock the scheduler. More...
 

Function Documentation

void os::rtos::port::scheduler::_wait_for_interrupt ( void  )
void os::rtos::port::scheduler::greeting ( void  )
result_t os::rtos::port::scheduler::initialize ( void  )

Initialise the RTOS scheduler.

Parameters
None.
Return values
result::okThe scheduler was initialised.
EPERMCannot be invoked from an Interrupt Service Routines.

Initialise all RTOS internal objects and be ready to run.

Must be called only once, usually in main().

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 50 of file trace.cpp.

port::scheduler::state_t os::rtos::port::scheduler::lock ( void  )
inline

Lock the scheduler.

Parameters
None.
Returns
The previous state of the scheduler lock.

Set the scheduler lock state to locked and return the previous state.

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 874 of file os-sched.h.

port::scheduler::state_t os::rtos::port::scheduler::locked ( state_t  state)
inline

Lock/unlock the scheduler.

Parameters
[in]stateThe new state of the scheduler lock.
Returns
The previous state of the scheduler lock.

Set the scheduler lock state based on the parameter and return the previous state.

This allows to implement scheduler critical sections, where the scheduler is disabled and context switches are not performed.

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 904 of file os-sched.h.

bool os::rtos::port::scheduler::locked ( void  )
inline

Check if the scheduler is locked.

Parameters
None.
Return values
trueThe scheduler is locked.
falseThe scheduler is switching threads (not locked).

Check if the scheduler is locked on the current thread or is switching threads from the ready list.

Note
Can be invoked from Interrupt Service Routines.

Definition at line 861 of file os-sched.h.

bool os::rtos::port::scheduler::preemptive ( void  )
inline

Check if the scheduler is in preemptive mode.

Parameters
None
Return values
trueThe scheduler is in preemptive mode.
falseThe scheduler is not in preemptive mode.

Check if the scheduler preemption is enabled.

Note
Can be invoked from Interrupt Service Routines.

Definition at line 844 of file os-sched.h.

bool os::rtos::port::scheduler::preemptive ( bool  state)

Set the scheduler preemptive mode.

Parameters
[in]stateThe new state of the scheduler preemptive mode.
Returns
The previous state of the preemptive mode.
Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 198 of file os-core.cpp.

void os::rtos::port::scheduler::reschedule ( void  )
void os::rtos::port::scheduler::start ( void  )

Start the RTOS scheduler.

Parameters
None.
Returns
Nothing.

The scheduler cannot be stopped, it will run forever, but thread switching can be locked/unlocked.

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 159 of file os-core.cpp.

stack::element_t* os::rtos::port::scheduler::switch_stacks ( stack::element_t *  sp)
port::scheduler::state_t os::rtos::port::scheduler::unlock ( void  )
inline

Unlock the scheduler.

Parameters
None.
Returns
The previous state of the scheduler lock.

Set the scheduler lock state to unlocked and return the previous state.

Warning
Cannot be invoked from Interrupt Service Routines.

Definition at line 887 of file os-sched.h.