From 742729ed2925aa1f6746fe3fe1ac74ffdef89e19 Mon Sep 17 00:00:00 2001 From: Stefan Innerhofer <33153046+InnerSteff@users.noreply.github.com> Date: Tue, 4 Mar 2025 10:55:19 +0100 Subject: [PATCH] Add an assert o catch overflow of recursive mutex counter (#1254) Add an assert o catch overflow of recursive mutex counter. --- queue.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/queue.c b/queue.c index e91d9e39b..fe06368d3 100644 --- a/queue.c +++ b/queue.c @@ -833,6 +833,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) { ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; + + /* Check if an overflow occurred. */ + configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount ); + xReturn = pdPASS; } else @@ -845,6 +849,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength, if( xReturn != pdFAIL ) { ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; + + /* Check if an overflow occurred. */ + configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount ); } else {