Add an assert o catch overflow of recursive mutex counter (#1254)

Add an assert o catch overflow of recursive mutex counter.
This commit is contained in:
Stefan Innerhofer 2025-03-04 10:55:19 +01:00 committed by GitHub
parent 60f34f8503
commit 742729ed29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -833,6 +833,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() )
{ {
( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++;
/* Check if an overflow occurred. */
configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount );
xReturn = pdPASS; xReturn = pdPASS;
} }
else else
@ -845,6 +849,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
if( xReturn != pdFAIL ) if( xReturn != pdFAIL )
{ {
( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++;
/* Check if an overflow occurred. */
configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount );
} }
else else
{ {