From da54520beb742ee4144b5d8222adcabcd3d3dcef Mon Sep 17 00:00:00 2001 From: John Boiles Date: Wed, 12 Feb 2025 10:37:51 -0800 Subject: [PATCH] POSIX Simulator: Assert if vPortYield called from a non-FreeRTOS thread --- portable/ThirdParty/GCC/Posix/port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index ff386ac9f..1153e7f67 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -384,6 +384,10 @@ static void prvPortYieldFromISR( void ) void vPortYield( void ) { + /* This must never be called from outside of a FreeRTOS-owned thread, or + * the thread could get stuck in a suspended state. */ + configASSERT( prvIsFreeRTOSThread() == pdTRUE ); + vPortEnterCritical(); prvPortYieldFromISR();