modm API documentation
|
#include <modm/processing/fiber/task.hpp>
Public Typedefs | |
using | id = uintptr_t |
using | binary_semaphore = counting_semaphore< 1 > |
Public Types | |
enum | Start |
Public Member Functions | |
template<class T > | |
Fiber (T &&task, fiber::Start start=fiber::Start::Now) | |
modm::fiber::id | get_id () const |
stop_source | get_stop_source () |
stop_token | get_stop_token () |
bool | isRunning () const |
void | join () |
bool | joinable () const |
Checks if the Task object identifies an active fiber of execution. | |
bool | request_stop () |
size_t | stack_usage () const |
void | stack_watermark () |
bool | start () |
Static Public Member Functions | |
static constexpr unsigned int | hardware_concurrency () |
Returns the number of concurrent threads supported by the implementation. | |
Static Public Attributes | |
static constexpr size_t | StackAlignment = sizeof(uintptr_t) * 2 |
Alignment requirements for the bottom and top of the stack. | |
static constexpr size_t | StackSizeMinimum = 44 |
Minimum stack size required to push one full fiber context. | |
static constexpr size_t | StackSizeDefault = 1024 |
enum | cv_status |
using | condition_variable = condition_variable_any |
There is no specialization for std::unique_lock<fiber::mutex> . | |
This class is a convenience extension of a fiber task, which contains the modm::fiber::Stack
as part of the class. The class is constructed at runtime only, therefore it is placed into the .bss
section by default and does not count towards your .data
section size. To speed up booting you may place the object into the modm_faststack
section.
using modm::Fiber< StackSize >::binary_semaphore = counting_semaphore<1> |
Implements the std::binary_semaphore
interface for fibers.
|
inheritednodiscardinline |
Returns a value of std::thread::id identifying the thread associated with *this
.
|
inheritednodiscardinline |
|
inheritedinline |
Blocks the current fiber until the fiber identified by *this
finishes its execution. Returns immediately if the thread is not joinable.
|
inheritedinline |
|
inheritednodiscardinline |
modm_context_stack_usage()
.
|
inheritedinline |
Watermarks the stack to measure stack_usage()
later.
modm_context_stack_watermark()
.
|
inherited |
Adds the task to the currently active scheduler, if not already running.