Update xPortRunning before resuming first task (#1049)

The variable `xPortRunning` is now updated before starting the first
task.

It fixes the following issue -
https://forums.freertos.org/t/possible-bug-in-the-way-prvtimertask-thread-function-is-started-in-win32-port/19959/

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
pull/1044/head^2
Gaurav-Aggarwal-AWS 10 months ago committed by GitHub
parent 2eb2d653bf
commit 78c8bbde0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -353,12 +353,12 @@ BaseType_t xPortStartScheduler( void )
pxThreadState = ( ThreadState_t * ) *( ( size_t * ) pxCurrentTCB ); pxThreadState = ( ThreadState_t * ) *( ( size_t * ) pxCurrentTCB );
ulCriticalNesting = portNO_CRITICAL_NESTING; ulCriticalNesting = portNO_CRITICAL_NESTING;
/* Start the first task. */
ResumeThread( pxThreadState->pvThread );
/* The scheduler is now running. */ /* The scheduler is now running. */
xPortRunning = pdTRUE; xPortRunning = pdTRUE;
/* Start the first task. */
ResumeThread( pxThreadState->pvThread );
/* Handle all simulated interrupts - including yield requests and /* Handle all simulated interrupts - including yield requests and
* simulated ticks. */ * simulated ticks. */
prvProcessSimulatedInterrupts(); prvProcessSimulatedInterrupts();

Loading…
Cancel
Save