Safe API Framework
0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
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
36
#include "
rte/utils/status/rte_status.h
"
37
#include "
rte/utils/types/rte_types.h
"
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
44
RTE_DECLARE_STORAGE
(rte_mutex_storage_t, 128U);
45
47
typedef
struct
rte_mutex_impl_s *
rte_mutex_handle_t
;
48
68
rte_status_t
rte_mutex_create
(rte_mutex_storage_t *storage,
rte_mutex_handle_t
*out_handle);
69
79
rte_status_t
rte_mutex_lock
(
rte_mutex_handle_t
handle);
80
102
rte_status_t
rte_mutex_lock_timed
(
rte_mutex_handle_t
handle,
rte_duration_ms_t
timeout_ms);
103
112
rte_status_t
rte_mutex_unlock
(
rte_mutex_handle_t
handle);
113
121
rte_status_t
rte_mutex_destroy
(
rte_mutex_handle_t
handle);
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_mutex_destroy
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_mutex_lock_timed
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_mutex_create
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_mutex_unlock
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
rte_mutex_handle_t
struct rte_mutex_impl_s * rte_mutex_handle_t
Definition
rte_mutex.h:47
rte_mutex_lock
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
rte_status_t
Common result/status codes.
Definition
rte_status.h:27
RTE_DECLARE_STORAGE
#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
rte_duration_ms_t
uint32_t rte_duration_ms_t
Definition
rte_types.h:27
rte_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
rte_types.h
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
include
rte
oal
mutex
rte_mutex.h
Generated by
1.18.0