From: rtel Date: Tue, 15 Oct 2019 22:14:40 +0000 (+0000) Subject: Move the call to traceTASK_DELETE() to before port portPRE_TASK_DELETE_HOOK() as... X-Git-Tag: V10.3.0~82 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c2caaac2c4c97ef835be5e971beeba3eef327d0;p=freertos Move the call to traceTASK_DELETE() to before port portPRE_TASK_DELETE_HOOK() as in the Windows port portPRE_TASK_DELETE_HOOK() never returns. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2741 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c index cf28a7184..dfff3ec5e 100644 --- a/FreeRTOS/Source/tasks.c +++ b/FreeRTOS/Source/tasks.c @@ -1204,6 +1204,10 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) check the xTasksWaitingTermination list. */ ++uxDeletedTasksWaitingCleanUp; + /* Call the delete hook before portPRE_TASK_DELETE_HOOK() as + portPRE_TASK_DELETE_HOOK() does not return in the Win32 port. */ + traceTASK_DELETE( pxTCB ); + /* The pre-delete hook is primarily for the Windows simulator, in which Windows specific clean up operations are performed, after which it is not possible to yield away from this task - @@ -1219,9 +1223,8 @@ static void prvAddNewTaskToReadyList( TCB_t *pxNewTCB ) /* Reset the next expected unblock time in case it referred to the task that has just been deleted. */ prvResetNextTaskUnblockTime(); + traceTASK_DELETE( pxTCB ); } - - traceTASK_DELETE( pxTCB ); } taskEXIT_CRITICAL();