Skip to content

Commit

Permalink
POSIX port - Fix subsequent scheduler starts by clearing xSchedulerEn…
Browse files Browse the repository at this point in the history
…d in xPortStartScheduler

Otherwise subsequent calls to xPortStartScheduler will incorrectly return immediately as
xSchedulerEnd was still set from the previous scheduler run.
  • Loading branch information
cmorganBE committed Dec 5, 2023
1 parent f38dd73 commit 5b90815
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions portable/ThirdParty/GCC/Posix/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ BaseType_t xPortStartScheduler( void )
int iSignal;
sigset_t xSignals;

/*
* clear out the variable that is used to end the scheduler, otherwise
* subsequent scheduler restarts will end immediately.
*/
xSchedulerEnd = pdFALSE;

hMainThread = pthread_self();

/* Start the timer that generates the tick ISR(SIGALRM).
Expand Down

0 comments on commit 5b90815

Please sign in to comment.