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.h
Go to the documentation of this file.
1
33#ifndef RTE_OS_MUTEX_H
34#define RTE_OS_MUTEX_H
35
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
44RTE_DECLARE_STORAGE(rte_mutex_storage_t, 128U);
45
47typedef struct rte_mutex_impl_s *rte_mutex_handle_t;
48
68rte_status_t rte_mutex_create(rte_mutex_storage_t *storage, rte_mutex_handle_t *out_handle);
69
80
103
113
122
123/*
124 * The OSAdapter vtable (rte_osadapter_mutex_t) and rte_osadapter_mutex_register()
125 * live in rte_osadapter/mutex/rte_osadapter_mutex.h, not here (ADR-021
126 * consumer/osadapter split). This header is the consumer-facing surface
127 * only - a real application never needs to see the OSAdapter vtable shape;
128 * only the platform integrator wiring a concrete OSAdapter does.
129 */
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif /* RTE_OS_MUTEX_H */
136 /* MUTEX */
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 ho...
Definition rte_mutex.c:128
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).
Definition rte_mutex.c:91
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-O...
Definition rte_mutex.c:44
rte_status_t rte_mutex_unlock(rte_mutex_handle_t handle)
Releases a mutex previously locked by the calling task.
Definition rte_mutex.c:111
struct rte_mutex_impl_s * rte_mutex_handle_t
Definition rte_mutex.h:47
rte_status_t rte_mutex_lock(rte_mutex_handle_t handle)
Blocks the calling task until it holds the mutex.
Definition rte_mutex.c:74
rte_status_t
Common result/status codes.
Definition rte_status.h:27
#define RTE_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition rte_types.h:69
uint32_t rte_duration_ms_t
Definition rte_types.h:27
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...