mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-09 23:53:04 -04:00
Merge c028ff4bf5 into 8be86d4a24
This commit is contained in:
commit
ec27f5231d
1 changed files with 14 additions and 0 deletions
14
queue.c
14
queue.c
|
|
@ -966,6 +966,20 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
{
|
||||
/* If the queue is a mutex and is held, only the owner can give it. */
|
||||
if( ( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) &&
|
||||
( pxQueue->u.xSemaphore.xMutexHolder != NULL ) &&
|
||||
( pxQueue->u.xSemaphore.xMutexHolder != xTaskGetCurrentTaskHandle() ) )
|
||||
{
|
||||
traceRETURN_xQueueGenericSend( pdFAIL );
|
||||
|
||||
return pdFAIL;
|
||||
}
|
||||
}
|
||||
#endif /* configUSE_MUTEXES */
|
||||
|
||||
for( ; ; )
|
||||
{
|
||||
taskENTER_CRITICAL();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue