freertos: check that mutex is released by owner task

Mutex type semaphores should be acquired and released by the same task.
Add a check to xQueueGenericSend for this condition.
This commit is contained in:
Ivan Grokhotkov
2018-12-21 12:49:33 +08:00
committed by bot
parent fc4823c885
commit 13523c95b4
4 changed files with 40 additions and 0 deletions

View File

@@ -724,6 +724,12 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
}
#endif
#if ( configUSE_MUTEXES == 1 && configCHECK_MUTEX_GIVEN_BY_OWNER == 1)
{
configASSERT(pxQueue->uxQueueType != queueQUEUE_IS_MUTEX || pxQueue->pxMutexHolder == NULL || xTaskGetCurrentTaskHandle() == pxQueue->pxMutexHolder);
}
#endif
/* This function relaxes the coding standard somewhat to allow return