Snapdragon® Telematics Application Framework (TelAF) Interface Specification
le_semaphore.h
Go to the documentation of this file.
1 
59 #ifndef LEGATO_SEMAPHORE_INCLUDE_GUARD
60 #define LEGATO_SEMAPHORE_INCLUDE_GUARD
61 
62 //--------------------------------------------------------------------------------------------------
67 //--------------------------------------------------------------------------------------------------
68 typedef struct le_sem_t* le_sem_Ref_t;
69 
70 
71 #if LE_CONFIG_SEM_NAMES_ENABLED
72 //--------------------------------------------------------------------------------------------------
81 //--------------------------------------------------------------------------------------------------
83 (
84  const char *name,
85  int32_t initialCount
86 );
87 #else /* if not LE_CONFIG_SEM_NAMES_ENABLED */
88 //--------------------------------------------------------------------------------------------------
93 //--------------------------------------------------------------------------------------------------
94 le_sem_Ref_t _le_sem_Create(int32_t initialCount);
96 //--------------------------------------------------------------------------------------------------
105 //--------------------------------------------------------------------------------------------------
107 (
108  const char *name,
109  int32_t initialCount
110 )
111 {
112  LE_UNUSED(name);
113  return _le_sem_Create(initialCount);
114 }
115 #endif /* end LE_CONFIG_SEM_NAMES_ENABLED */
116 
117 
118 //--------------------------------------------------------------------------------------------------
123 //--------------------------------------------------------------------------------------------------
124 void le_sem_Delete
125 (
126  le_sem_Ref_t semaphorePtr
127 );
128 
129 
130 #if LE_CONFIG_SEM_NAMES_ENABLED
131 //--------------------------------------------------------------------------------------------------
140 //--------------------------------------------------------------------------------------------------
142 (
143  const char* name
144 );
145 #else /* if not LE_CONFIG_SEM_NAMES_ENABLED */
146 //--------------------------------------------------------------------------------------------------
155 //--------------------------------------------------------------------------------------------------
157 (
158  const char* name
159 )
160 {
161  LE_UNUSED(name);
162  // Cannot look up semaphores by name if names do not exist.
163  return NULL;
164 }
165 #endif /* end LE_CONFIG_SEM_NAMES_ENABLED */
166 
167 //--------------------------------------------------------------------------------------------------
173 //--------------------------------------------------------------------------------------------------
174 void le_sem_Wait
175 (
176  le_sem_Ref_t semaphorePtr
177 );
178 
179 //--------------------------------------------------------------------------------------------------
189 //--------------------------------------------------------------------------------------------------
191 (
192  le_sem_Ref_t semaphorePtr
193 );
194 
195 //--------------------------------------------------------------------------------------------------
205 //--------------------------------------------------------------------------------------------------
207 (
208  le_sem_Ref_t semaphorePtr,
209  le_clk_Time_t timeToWait
210 );
211 
212 //--------------------------------------------------------------------------------------------------
218 //--------------------------------------------------------------------------------------------------
219 void le_sem_Post
220 (
221  le_sem_Ref_t semaphorePtr
222 );
223 
224 //--------------------------------------------------------------------------------------------------
230 //--------------------------------------------------------------------------------------------------
231 int le_sem_GetValue
232 (
233  le_sem_Ref_t semaphorePtr
234 );
235 
236 #endif // LEGATO_SEMAPHORE_INCLUDE_GUARD
void le_sem_Wait(le_sem_Ref_t semaphorePtr)
le_result_t le_sem_TryWait(le_sem_Ref_t semaphorePtr)
Definition: le_clock.h:98
int le_sem_GetValue(le_sem_Ref_t semaphorePtr)
#define LE_UNUSED(v)
Definition: le_basics.h:379
#define LE_DECLARE_INLINE
Definition: le_basics.h:330
LE_DECLARE_INLINE le_sem_Ref_t le_sem_FindSemaphore(const char *name)
Definition: le_semaphore.h:157
le_result_t le_sem_WaitWithTimeOut(le_sem_Ref_t semaphorePtr, le_clk_Time_t timeToWait)
struct le_sem_t * le_sem_Ref_t
Definition: le_semaphore.h:68
LE_DECLARE_INLINE le_sem_Ref_t le_sem_Create(const char *name, int32_t initialCount)
Definition: le_semaphore.h:107
void le_sem_Delete(le_sem_Ref_t semaphorePtr)
le_result_t
Definition: le_basics.h:45
void le_sem_Post(le_sem_Ref_t semaphorePtr)