int wilc_mq_create(struct message_queue *pHandle)
{
spin_lock_init(&pHandle->strCriticalSection);
- sema_init(&pHandle->hSem, 0);
+ sema_init(&pHandle->sem, 0);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
pHandle->bExiting = false;
/* Release any waiting receiver thread. */
while (pHandle->u32ReceiversCount > 0) {
- up(&pHandle->hSem);
+ up(&pHandle->sem);
pHandle->u32ReceiversCount--;
}
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- up(&pHandle->hSem);
+ up(&pHandle->sem);
return 0;
}
pHandle->u32ReceiversCount++;
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- down(&pHandle->hSem);
+ down(&pHandle->sem);
spin_lock_irqsave(&pHandle->strCriticalSection, flags);
pstrMessage = pHandle->pstrMessageList;
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
- up(&pHandle->hSem);
+ up(&pHandle->sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
}