00001 00096 #ifndef LEGATO_SEMAPHORE_INCLUDE_GUARD 00097 #define LEGATO_SEMAPHORE_INCLUDE_GUARD 00098 00099 //-------------------------------------------------------------------------------------------------- 00104 //-------------------------------------------------------------------------------------------------- 00105 typedef struct le_sem_t* le_sem_Ref_t; 00106 00107 //-------------------------------------------------------------------------------------------------- 00113 //-------------------------------------------------------------------------------------------------- 00114 le_sem_Ref_t le_sem_Create 00115 ( 00116 const char* name, 00117 int32_t initialCount 00118 ); 00119 00120 //-------------------------------------------------------------------------------------------------- 00126 //-------------------------------------------------------------------------------------------------- 00127 le_sem_Ref_t le_sem_CreateTraceable 00128 ( 00129 const char* name, 00130 int32_t initialCount 00131 ); 00132 00133 //-------------------------------------------------------------------------------------------------- 00138 //-------------------------------------------------------------------------------------------------- 00139 void le_sem_Delete 00140 ( 00141 le_sem_Ref_t semaphorePtr 00142 ); 00143 00144 //-------------------------------------------------------------------------------------------------- 00151 //-------------------------------------------------------------------------------------------------- 00152 le_sem_Ref_t le_sem_FindSemaphore 00153 ( 00154 const char* name 00155 ); 00156 00157 //-------------------------------------------------------------------------------------------------- 00163 //-------------------------------------------------------------------------------------------------- 00164 void le_sem_Wait 00165 ( 00166 le_sem_Ref_t semaphorePtr 00167 ); 00168 00169 //-------------------------------------------------------------------------------------------------- 00179 //-------------------------------------------------------------------------------------------------- 00180 le_result_t le_sem_TryWait 00181 ( 00182 le_sem_Ref_t semaphorePtr 00183 ); 00184 00185 //-------------------------------------------------------------------------------------------------- 00191 //-------------------------------------------------------------------------------------------------- 00192 void le_sem_Post 00193 ( 00194 le_sem_Ref_t semaphorePtr 00195 ); 00196 00197 //-------------------------------------------------------------------------------------------------- 00203 //-------------------------------------------------------------------------------------------------- 00204 int le_sem_GetValue 00205 ( 00206 le_sem_Ref_t semaphorePtr 00207 ); 00208 00209 #endif // LEGATO_SEMAPHORE_INCLUDE_GUARD