diff --git a/.github/workflows/kernel-demos.yml b/.github/workflows/kernel-demos.yml index b29209c105..9a74e3d00e 100644 --- a/.github/workflows/kernel-demos.yml +++ b/.github/workflows/kernel-demos.yml @@ -65,7 +65,13 @@ jobs: POSIX-GCC: name: Native GCC - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - macos-latest + - ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: Checkout the FreeRTOS/FreeRTOS Repository uses: actions/checkout@v3 @@ -83,6 +89,7 @@ jobs: - name: Install GCC shell: bash + if: matrix.os == 'ubuntu-latest' run: | sudo apt-get -y update sudo apt-get -y install build-essential diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index f845173461..65ba54c7b6 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -281,10 +282,15 @@ BaseType_t xPortStartScheduler( void ) */ xSchedulerEnd = pdFALSE; - /* Reset the pthread_once_t structure. This is required if the port - * starts the scheduler again. */ - hSigSetupThread = PTHREAD_ONCE_INIT; - + /* Reset pthread_once_t, needed to restart the scheduler again. + * memset the internal struct members for MacOS/Linux Compatability */ + #if __APPLE__ + hSigSetupThread.__sig = _PTHREAD_ONCE_SIG_init; + memset( ( void * ) &hSigSetupThread.__opaque, 0, sizeof(hSigSetupThread.__opaque)); + #else /* Linux PTHREAD library*/ + hSigSetupThread = PTHREAD_ONCE_INIT; + #endif /* __APPLE__*/ + /* Restore original signal mask. */ ( void ) pthread_sigmask( SIG_SETMASK, &xSchedulerOriginalSignalMask, NULL );