From 5c2caaac2c4c97ef835be5e971beeba3eef327d0 Mon Sep 17 00:00:00 2001 From: rtel Date: Tue, 15 Oct 2019 22:14:40 +0000 Subject: [PATCH] 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 --- FreeRTOS/Source/tasks.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); -- 2.39.5