From ada4744871be753223a8742e9cf3009b4cb3e636 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Sun, 6 Apr 2008 09:37:26 +0000 Subject: [PATCH] Minor changes to the trace macros. --- Source/queue.c | 12 ++++++------ Source/tasks.c | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/queue.c b/Source/queue.c index 2c49c8360a..d043f95ecc 100644 --- a/Source/queue.c +++ b/Source/queue.c @@ -314,6 +314,8 @@ size_t xQueueSizeInBytes; mutual exclusion is required to test the pxMutexHolder variable. */ if( pxMutex->pxMutexHolder == xTaskGetCurrentTaskHandle() ) { + traceGIVE_MUTEX_RECURSIVE( pxMutex ); + /* uxRecursiveCallCount cannot be zero if pxMutexHolder is equal to the task handle, therefore no underflow check is required. Also, uxRecursiveCallCount is only modified by the mutex holder, and as @@ -329,9 +331,7 @@ size_t xQueueSizeInBytes; xQueueGenericSend( pxMutex, NULL, queueMUTEX_GIVE_BLOCK_TIME, queueSEND_TO_BACK ); } - xReturn = pdPASS; - - traceGIVE_MUTEX_RECURSIVE( pxMutex ); + xReturn = pdPASS; } else { @@ -356,6 +356,8 @@ size_t xQueueSizeInBytes; /* Comments regarding mutual exclusion as per those within xQueueGiveMutexRecursive(). */ + traceTAKE_MUTEX_RECURSIVE( pxMutex ); + if( pxMutex->pxMutexHolder == xTaskGetCurrentTaskHandle() ) { ( pxMutex->uxRecursiveCallCount )++; @@ -371,9 +373,7 @@ size_t xQueueSizeInBytes; { ( pxMutex->uxRecursiveCallCount )++; } - } - - traceTAKE_MUTEX_RECURSIVE( pxMutex ); + } return xReturn; } diff --git a/Source/tasks.c b/Source/tasks.c index 065004b4a1..994c23387f 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -1414,6 +1414,8 @@ inline void vTaskIncrementTick( void ) void vTaskSwitchContext( void ) { + traceTASK_SWITCHED_OUT(); + if( uxSchedulerSuspended != ( unsigned portBASE_TYPE ) pdFALSE ) { /* The scheduler is currently suspended - do not allow a context