From 9760e450315813fe31a970e19fbea1fbd775cdf6 Mon Sep 17 00:00:00 2001 From: Gaurav Aggarwal Date: Thu, 3 Apr 2025 08:26:41 +0000 Subject: [PATCH] Code review suggestions Signed-off-by: Gaurav Aggarwal --- portable/ThirdParty/GCC/Posix/port.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index 1f23ba27a..b5a4a1b62 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -48,8 +48,8 @@ * stdio (printf() and friends) should be called from a single task * only or serialized with a FreeRTOS primitive such as a binary * semaphore or mutex. -* -* Note: When using LLDB (the default debugger on macOS) with this port, +* +* Note: When using LLDB (the default debugger on macOS) with this port, * suppress SIGUSR1 to prevent debugger interference. This can be * done by adding the following line to ~/.lldbinit: * `process handle SIGUSR1 -n true -p false -s false` @@ -324,6 +324,7 @@ BaseType_t xPortStartScheduler( void ) void vPortEndScheduler( void ) { Thread_t * pxCurrentThread; + BaseType_t xIsFreeRTOSThread; /* Stop the timer tick thread. */ xTimerTickThreadShouldRun = false; @@ -332,14 +333,14 @@ void vPortEndScheduler( void ) /* Check whether the current thread is a FreeRTOS thread. * This has to happen before the scheduler is signaled to exit * its loop to prevent data races on the thread key. */ - BaseType_t is_freertos_thread = prvIsFreeRTOSThread(); + xIsFreeRTOSThread = prvIsFreeRTOSThread(); /* Signal the scheduler to exit its loop. */ xSchedulerEnd = pdTRUE; ( void ) pthread_kill( hMainThread, SIG_RESUME ); /* Waiting to be deleted here. */ - if( is_freertos_thread == pdTRUE ) + if( xIsFreeRTOSThread == pdTRUE ) { pxCurrentThread = prvGetThreadFromTask( xTaskGetCurrentTaskHandle() ); event_wait( pxCurrentThread->ev );