Parcourir la source

freertos: Restore the check that mutex is given by owner

Even without this check, if the owner doesn't match then FreeRTOS will still
fail an assertion - but it's not as clear what the root cause is.
Angus Gratton il y a 5 ans
Parent
commit
c87fe77ef9
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      components/freertos/queue.c

+ 5 - 0
components/freertos/queue.c

@@ -770,6 +770,11 @@ Queue_t * const pxQueue = xQueue;
 	}
 	}
 	#endif
 	#endif
 
 
+#if ( configUSE_MUTEXES == 1 && configCHECK_MUTEX_GIVEN_BY_OWNER == 1)
+	configASSERT(pxQueue->uxQueueType != queueQUEUE_IS_MUTEX
+				 || pxQueue->u.xSemaphore.xMutexHolder == NULL
+				 || pxQueue->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle());
+#endif
 
 
 	/*lint -save -e904 This function relaxes the coding standard somewhat to
 	/*lint -save -e904 This function relaxes the coding standard somewhat to
 	allow return statements within the function itself.  This is done in the
 	allow return statements within the function itself.  This is done in the