le_mutex.h
Go to the documentation of this file.
1 
78 //--------------------------------------------------------------------------------------------------
86 //--------------------------------------------------------------------------------------------------
87 
88 #ifndef LEGATO_MUTEX_INCLUDE_GUARD
89 #define LEGATO_MUTEX_INCLUDE_GUARD
90 
91 //--------------------------------------------------------------------------------------------------
95 //--------------------------------------------------------------------------------------------------
96 typedef struct le_mutex* le_mutex_Ref_t;
97 
98 //--------------------------------------------------------------------------------------------------
106 //--------------------------------------------------------------------------------------------------
108 (
109  const char* nameStr
110 );
111 
112 //--------------------------------------------------------------------------------------------------
120 //--------------------------------------------------------------------------------------------------
122 (
123  const char* nameStr
124 );
125 
126 //--------------------------------------------------------------------------------------------------
132 //--------------------------------------------------------------------------------------------------
133 void le_mutex_Delete
134 (
135  le_mutex_Ref_t mutexRef
136 );
137 
138 //--------------------------------------------------------------------------------------------------
144 //--------------------------------------------------------------------------------------------------
145 void le_mutex_Lock
146 (
147  le_mutex_Ref_t mutexRef
148 );
149 
150 //--------------------------------------------------------------------------------------------------
160 //--------------------------------------------------------------------------------------------------
162 (
163  le_mutex_Ref_t mutexRef
164 );
165 
166 //--------------------------------------------------------------------------------------------------
172 //--------------------------------------------------------------------------------------------------
173 void le_mutex_Unlock
174 (
175  le_mutex_Ref_t mutexRef
176 );
177 
178 //--------------------------------------------------------------------------------------------------
198 //--------------------------------------------------------------------------------------------------
199 #define LE_MUTEX_DECLARE_REF(refName) \
200  static le_mutex_Ref_t refName; \
201  static inline void Lock(void) { le_mutex_Lock(refName); } \
202  static inline void Unlock(void) { le_mutex_Unlock(refName); }
203 
204 #endif /* LEGATO_MUTEX_INCLUDE_GUARD */
le_result_t
Definition: le_basics.h:35
struct le_mutex * le_mutex_Ref_t
Definition: le_mutex.h:96
le_mutex_Ref_t le_mutex_CreateRecursive(const char *nameStr)
void le_mutex_Lock(le_mutex_Ref_t mutexRef)
le_result_t le_mutex_TryLock(le_mutex_Ref_t mutexRef)
le_mutex_Ref_t le_mutex_CreateNonRecursive(const char *nameStr)
void le_mutex_Delete(le_mutex_Ref_t mutexRef)
void le_mutex_Unlock(le_mutex_Ref_t mutexRef)