X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FSource%2Ftasks.c;h=ef92565c20b077696ad3a35942360953139e8d26;hb=da7e10b40a91f08040d79c4d5ae98d8961ec1422;hp=51b75b4e696aae0d9551395fe73641f32c4bfd38;hpb=a3b058fa5e2f4bb6ccbaaf2863399edf6f6fff6f;p=freertos diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c index 51b75b4e6..ef92565c2 100644 --- a/FreeRTOS/Source/tasks.c +++ b/FreeRTOS/Source/tasks.c @@ -56,19 +56,19 @@ *************************************************************************** - http://www.FreeRTOS.org - Documentation, books, training, latest versions, + http://www.FreeRTOS.org - Documentation, books, training, latest versions, license and Real Time Engineers Ltd. contact details. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, and our new fully thread aware and reentrant UDP/IP stack. - http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High - Integrity Systems, who sell the code with commercial support, + http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High + Integrity Systems, who sell the code with commercial support, indemnification and middleware, under the OpenRTOS brand. - - http://www.SafeRTOS.com - High Integrity Systems also provide a safety - engineered and independently SIL3 certified version for use in safety and + + http://www.SafeRTOS.com - High Integrity Systems also provide a safety + engineered and independently SIL3 certified version for use in safety and mission critical applications that require provable dependability. */ @@ -204,7 +204,7 @@ PRIVILEGED_DATA static volatile portTickType xNextTaskUnblockTime = ( portTic PRIVILEGED_DATA static char pcStatsString[ 50 ] ; PRIVILEGED_DATA static unsigned long ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */ - PRIVILEGED_DATA static unsigned long ulTotalRunTime; /*< Holds the total amount of execution time as defined by the run time counter clock. */ + PRIVILEGED_DATA static unsigned long ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */ static void prvGenerateRunTimeStatsForTasksInList( const signed char *pcWriteBuffer, xList *pxList, unsigned long ulTotalRunTimeDiv100 ) PRIVILEGED_FUNCTION; #endif @@ -709,6 +709,14 @@ tskTCB * pxNewTCB; if( ( void * ) xTaskToDelete == NULL ) { portYIELD_WITHIN_API(); + + /* Ensure the task goes no further if it takes a few + instructions for the yield to occur. */ + for( ;; ) + { + /* Nothing to do here, just ensuring the task does not + execute further before the yield has taken effect. */ + } } } } @@ -1030,13 +1038,13 @@ tskTCB * pxNewTCB; { portYIELD_WITHIN_API(); } + + /* Remove compiler warning about unused variables when the port + optimised task selection is not being used. */ + ( void ) uxPriorityUsedOnEntry; } } taskEXIT_CRITICAL(); - - /* Remove compiler warning about unused parameter when the port - optimised task selection is not being used. */ - ( void ) uxPriorityUsedOnEntry; } #endif /* INCLUDE_vTaskPrioritySet */ @@ -2151,6 +2159,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) #if ( configUSE_TICKLESS_IDLE != 0 ) { portTickType xExpectedIdleTime; + /* It is not desirable to suspend then resume the scheduler on each iteration of the idle task. Therefore, a preliminary test of the expected idle time is performed without the