Earlier the code was suspending the current thread after calling vTaskSwitchContext. This left a gap where the current thread could access incorrect pxCurrentTCB after it was changed by vTaskSwitchContext.
This PR addresses the problem by suspending the current thread before calling vTaskSwitchContext.
Description
Earlier the code was suspending the current thread after calling vTaskSwitchContext. This left a gap where the current thread could access incorrect pxCurrentTCB after it was changed by vTaskSwitchContext.
This PR addresses the problem by suspending the current thread before calling vTaskSwitchContext.
Test Steps
Build and run the following demo - https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/WIN32-MSVC
Checklist:
Related Issue
https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/1054.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.