Skip to content

Commit 742729e

Browse files
authored
Add an assert o catch overflow of recursive mutex counter (#1254)
Add an assert o catch overflow of recursive mutex counter.
1 parent 60f34f8 commit 742729e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

queue.c

+7
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,10 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
833833
if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() )
834834
{
835835
( pxMutex->u.xSemaphore.uxRecursiveCallCount )++;
836+
837+
/* Check if an overflow occurred. */
838+
configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount );
839+
836840
xReturn = pdPASS;
837841
}
838842
else
@@ -845,6 +849,9 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
845849
if( xReturn != pdFAIL )
846850
{
847851
( pxMutex->u.xSemaphore.uxRecursiveCallCount )++;
852+
853+
/* Check if an overflow occurred. */
854+
configASSERT( pxMutex->u.xSemaphore.uxRecursiveCallCount );
848855
}
849856
else
850857
{

0 commit comments

Comments
 (0)