2 #include "wilc_oswrapper.h"
4 WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle,
5 tstrWILC_SemaphoreAttrs *pstrAttrs)
7 tstrWILC_SemaphoreAttrs strDefaultAttrs;
8 if (pstrAttrs == WILC_NULL) {
9 WILC_SemaphoreFillDefault(&strDefaultAttrs);
10 pstrAttrs = &strDefaultAttrs;
13 sema_init(pHandle, pstrAttrs->u32InitCount);
19 WILC_ErrNo WILC_SemaphoreDestroy(WILC_SemaphoreHandle *pHandle,
20 tstrWILC_SemaphoreAttrs *pstrAttrs)
22 /* nothing to be done ! */
29 WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle,
30 tstrWILC_SemaphoreAttrs *pstrAttrs)
32 WILC_ErrNo s32RetStatus = WILC_SUCCESS;
34 while (down_interruptible(pHandle))
37 if (s32RetStatus == 0) {
39 } else if (s32RetStatus == -ETIME) {
49 WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle,
50 tstrWILC_SemaphoreAttrs *pstrAttrs)