POSIX Simulator: Assert if vPortYield called from a non-FreeRTOS thread (#1247)
diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c
index ff386ac..1153e7f 100644
--- a/portable/ThirdParty/GCC/Posix/port.c
+++ b/portable/ThirdParty/GCC/Posix/port.c
@@ -384,6 +384,10 @@
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();