modm API documentation
modm::fiber::Scheduler Class Reference

#include <modm/processing/fiber/scheduler.hpp>

Static Public Member Functions

static constexpr unsigned int hardware_concurrency ()
 
static void run ()
 Runs the currently active scheduler.
 

Protected Member Functions

uintptr_t get_id () const
 
void runNext (Task *task)
 
void runLast (Task *task)
 
TaskremoveCurrent ()
 
bool empty () const
 
void jump (Task *other)
 
void yield ()
 
void unschedule ()
 
void add (Task *task)
 
bool start ()
 

Static Protected Member Functions

static bool isInsideInterrupt ()
 
static Scheduler & instance ()
 Returns the currently active scheduler.
 

Protected Attributes

Tasklast {nullptr}
 
Taskcurrent {nullptr}
 

Friends

class Task
 
void modm::this_fiber::yield ()
 
modm::fiber::id modm::this_fiber::get_id ()
 

Detailed Description

The scheduler executes fibers in a simple round-robin fashion. Fibers can be added to a scheduler using the modm::fiber::Task::start() function, also while the scheduler is running. Fibers returning from their function will automatically unschedule themselves.


The documentation for this class was generated from the following file: