Restarting the scheduler doesn't work on MacOS, or on linux from what I can tell. Ran the tests that were linked in the PR to add this feature in and I hit a segfault. For now just putting a configASSERT() in there if the scheduler is stopped on MacOS so that the port can build and run in an endless loop.

This commit is contained in:
Soren Ptak 2024-01-18 12:15:15 -05:00
parent 7fd4033a53
commit a33c692f75

View file

@ -270,7 +270,9 @@ BaseType_t xPortStartScheduler( void )
/* Reset pthread_once_t, needed to restart the scheduler again.
* memset the internal struct members for MacOS/Linux Compatability */
#if __APPLE__
memset( ( void * ) &hSigSetupThread.__sig, _PTHREAD_ONCE_SIG_init, sizeof(_PTHREAD_ONCE_SIG_init));
/* Restarting the scheduler is currently unsupported on MacOS. */
configASSERT( pdFALSE );
hSigSetupThread.__sig = _PTHREAD_ONCE_SIG_init;
memset( ( void * ) &hSigSetupThread.__opaque, 0, sizeof(hSigSetupThread.__opaque));
#else /* Linux PTHREAD library*/
hSigSetupThread = PTHREAD_ONCE_INIT;