This commit is contained in:
Patrick Cook 2026-08-27 02:53:20 -07:00 • committed by GitHub
commit ec27f5231d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

14
queue.c
View file

@ -966,6 +966,20 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
} }
#endif #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( ; ; ) for( ; ; )
{ {
taskENTER_CRITICAL(); taskENTER_CRITICAL();