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.h
Go to the documentation of this file.
1
30#ifndef SAFEAPI_OS_MUTEX_H
31#define SAFEAPI_OS_MUTEX_H
32
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
41SAFEAPI_DECLARE_STORAGE(sapi_mutex_storage_t, 128U);
42
44typedef struct sapi_mutex_impl_s *sapi_mutex_handle_t;
45
61sapi_status_t sapi_mutex_create(sapi_mutex_storage_t *storage, sapi_mutex_handle_t *out_handle);
62
73
83
92
93/*
94 * The backend vtable (sapi_mutex_backend_t) and sapi_mutex_register_backend()
95 * live in safeapi_backend/mutex/sapi_mutex_backend.h, not here (ADR-021
96 * consumer/backend split). This header is the consumer-facing surface
97 * only - a real application never needs to see the backend vtable shape;
98 * only the platform integrator wiring a concrete backend does.
99 */
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* SAFEAPI_OS_MUTEX_H */
106 /* MUTEX */
struct sapi_mutex_impl_s * sapi_mutex_handle_t
Definition sapi_mutex.h:44
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 hold...
Definition sapi_mutex.c:108
sapi_status_t sapi_mutex_unlock(sapi_mutex_handle_t handle)
Releases a mutex previously locked by the calling task.
Definition sapi_mutex.c:91
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.
Definition sapi_mutex.c:44
sapi_status_t sapi_mutex_lock(sapi_mutex_handle_t handle)
Blocks the calling task until it holds the mutex.
Definition sapi_mutex.c:74
sapi_status_t
Common result/status codes.
Definition sapi_status.h:27
#define SAFEAPI_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition sapi_types.h:69
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...