Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
Task/Thread Scheduling

Periodic/cyclic safety task creation with fixed priorities (ADR-001). More...

Files

file  src/oal/task/rte_task.c
 Task service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_task_register() (ADR-005).

Data Structures

struct  rte_task_config_t
 Configuration for rte_task_create(). More...

Typedefs

typedef struct rte_task_impl_s * rte_task_handle_t
 Opaque handle to a created task, returned by rte_task_create().
typedef void(*) rte_task_entry_t(void *user_ctx)
 Task entry point, invoked cyclically at the configured period.

Functions

 RTE_DECLARE_STORAGE (rte_task_storage_t, 128U)
 Caller-owned, fixed-size storage backing one rte_task_handle_t.
rte_status_t rte_task_create (rte_task_storage_t *storage, const rte_task_config_t *config, rte_task_handle_t *out_handle)
 Creates a task in the suspended state.
rte_status_t rte_task_start (rte_task_handle_t handle)
 Starts a created task.
rte_status_t rte_task_suspend (rte_task_handle_t handle)
 Suspends a running task.
rte_status_t rte_task_destroy (rte_task_handle_t handle)
 Terminates and destroys a task.

Detailed Description

Periodic/cyclic safety task creation with fixed priorities (ADR-001).

Typedef Documentation

◆ rte_task_handle_t

typedef struct rte_task_impl_s* rte_task_handle_t

Opaque handle to a created task, returned by rte_task_create().

Definition at line 32 of file rte_task.h.

◆ rte_task_entry_t

typedef void(*) rte_task_entry_t(void *user_ctx)

Task entry point, invoked cyclically at the configured period.

Definition at line 35 of file rte_task.h.

Function Documentation

◆ rte_task_create()

rte_status_t rte_task_create ( rte_task_storage_t * storage,
const rte_task_config_t * config,
rte_task_handle_t * out_handle )

Creates a task in the suspended state.

Parameters
storageCaller-owned storage for the handle's state. Must not be NULL.
configTask configuration. Must not be NULL; config->entry must not be NULL.
out_handleReceives the created task's handle. Must not be NULL.
Returns
RTE_STATUS_OK; RTE_STATUS_INVALID_PARAM for a bad argument; RTE_STATUS_NOT_INITIALIZED if no OSAdapter is registered (rte_osadapter_task_register()); RTE_STATUS_NOT_SUPPORTED if the registered OSAdapter does not implement create. REQ-OAL-TASK-010

Definition at line 44 of file rte_task.c.

◆ rte_task_start()

rte_status_t rte_task_start ( rte_task_handle_t handle)

Starts a created task.

Parameters
handleTask handle. Must not be NULL.
Returns
RTE_STATUS_OK, RTE_STATUS_INVALID_PARAM, RTE_STATUS_NOT_INITIALIZED, or RTE_STATUS_NOT_SUPPORTED (see rte_task_create()). REQ-OAL-TASK-011

Definition at line 77 of file rte_task.c.

◆ rte_task_suspend()

rte_status_t rte_task_suspend ( rte_task_handle_t handle)

Suspends a running task.

Parameters
handleTask handle. Must not be NULL.
Returns
See rte_task_start(). REQ-OAL-TASK-012

Definition at line 103 of file rte_task.c.

◆ rte_task_destroy()

rte_status_t rte_task_destroy ( rte_task_handle_t handle)

Terminates and destroys a task.

Parameters
handleTask handle. Must not be NULL. Invalid to use after this call.
Returns
See rte_task_start(). REQ-OAL-TASK-013

Definition at line 120 of file rte_task.c.