Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_mutex.c File Reference

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

Include dependency graph for sapi_mutex.c:

Go to the source code of this file.

Functions

sapi_status_t sapi_mutex_register_backend (const sapi_mutex_backend_t *backend)
 Registers the backend implementation used by every sapi_mutex_* call. This is how an integrator supplies their own mutex implementation - call once at startup, before any other sapi_mutex_* function.
sapi_status_t sapi_mutex_create (sapi_mutex_storage_t *storage, sapi_mutex_handle_t *out_handle)
 Creates (and initializes, unlocked) a mutex bound to caller-owned storage.
sapi_status_t sapi_mutex_lock (sapi_mutex_handle_t handle)
 Blocks the calling task until it holds the mutex.
sapi_status_t sapi_mutex_unlock (sapi_mutex_handle_t handle)
 Releases a mutex previously locked by the calling task.
sapi_status_t sapi_mutex_destroy (sapi_mutex_handle_t handle)
 Destroys a mutex, releasing any backend resources bound to it. Must not be called while any task holds or is waiting on the lock.

Variables

static const sapi_mutex_backend_ts_backend = NULL
 Currently registered backend, or NULL if none (ADR-033).

Detailed Description

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

Definition in file sapi_mutex.c.

Variable Documentation

◆ s_backend

const sapi_mutex_backend_t* s_backend = NULL
static

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

Local makros Local types declarations Local variables declarations

Definition at line 17 of file sapi_mutex.c.