From: richardbarry Date: Sun, 6 Apr 2008 09:37:26 +0000 (+0000) Subject: Minor changes to the trace macros. X-Git-Tag: V5.0.0~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d57e80e615c5313f69db751156af3da6ed231b3;p=freertos Minor changes to the trace macros. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@296 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/queue.c b/Source/queue.c index 2c49c8360..d043f95ec 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 065004b4a..994c23387 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