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
rte_mutex.c File Reference

Mutex service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_mutex_register() (ADR-033). More...

Include dependency graph for rte_mutex.c:

Go to the source code of this file.

Functions

rte_status_t rte_osadapter_mutex_register (const rte_osadapter_mutex_t *osadapter)
 Registers the OSAdapter mutex implementation.
rte_status_t rte_mutex_create (rte_mutex_storage_t *storage, rte_mutex_handle_t *out_handle)
 Creates (and initializes, unlocked) a priority-inheritance mutex bound to caller-owned storage (REQ-OAL-MUTEX-004).
rte_status_t rte_mutex_lock (rte_mutex_handle_t handle)
 Blocks the calling task until it holds the mutex.
rte_status_t rte_mutex_lock_timed (rte_mutex_handle_t handle, rte_duration_ms_t timeout_ms)
 Waits at most timeout_ms for the mutex (OSA rule R2: every wait bounded).
rte_status_t rte_mutex_unlock (rte_mutex_handle_t handle)
 Releases a mutex previously locked by the calling task.
rte_status_t rte_mutex_destroy (rte_mutex_handle_t handle)
 Destroys a mutex, releasing any OSAdapter resources bound to it. Must not be called while any task holds or is waiting on the lock.

Variables

static const rte_osadapter_mutex_t * s_osadapter = NULL
 Currently registered OSAdapter, or NULL if none (ADR-033).

Detailed Description

Mutex service: validates parameters, then dispatches to the OSAdapter registered via rte_osadapter_mutex_register() (ADR-033).

Definition in file rte_mutex.c.

Function Documentation

◆ rte_osadapter_mutex_register()

rte_status_t rte_osadapter_mutex_register ( const rte_osadapter_mutex_t * adapter)

Registers the OSAdapter mutex implementation.

Global variables declarations Local function declarations Global functions

Parameters
adapterPointer to mutex operations vtable.
Returns
RTE_STATUS_OK on success, RTE_STATUS_INVALID_PARAM if adapter is NULL, or RTE_STATUS_INVALID_STATE if the setup phase is already locked (REQ-LIFECYCLE-001, ADR-026; the previous registration, if any, is kept).

Definition at line 25 of file rte_mutex.c.

Variable Documentation

◆ s_osadapter

const rte_osadapter_mutex_t* s_osadapter = NULL
static

Currently registered OSAdapter, or NULL if none (ADR-033).

Local makros Local types declarations Local variables declarations

Definition at line 17 of file rte_mutex.c.