PR feedback to eliminate early returns

This commit is contained in:
John Boiles 2025-01-24 16:32:57 -08:00
parent e6b62d18e7
commit 8110c05629

View file

@ -368,21 +368,19 @@ void vPortYield( void )
void vPortDisableInterrupts( void )
{
if( prvIsFreeRTOSThread( pthread_self() ) == pdFALSE )
if( prvIsFreeRTOSThread( pthread_self() ) == pdTRUE )
{
return;
}
pthread_sigmask(SIG_BLOCK, &xAllSignals, NULL);
}
}
/*-----------------------------------------------------------*/
void vPortEnableInterrupts( void )
{
if( prvIsFreeRTOSThread( pthread_self() ) == pdFALSE )
if( prvIsFreeRTOSThread( pthread_self() ) == pdTRUE )
{
return;
}
pthread_sigmask(SIG_UNBLOCK, &xAllSignals, NULL);
}
}
/*-----------------------------------------------------------*/
@ -452,12 +450,8 @@ void prvSetupTimerInterrupt( void )
static void vPortSystemTickHandler( int sig )
{
if( prvIsFreeRTOSThread( pthread_self() ) == pdFALSE )
if( prvIsFreeRTOSThread( pthread_self() ) == pdTRUE )
{
fprintf( stderr, "vPortSystemTickHandler called from non-FreeRTOS thread\n" );
return;
}
Thread_t * pxThreadToSuspend;
Thread_t * pxThreadToResume;
@ -478,6 +472,9 @@ static void vPortSystemTickHandler( int sig )
}
uxCriticalNesting--;
} else {
fprintf( stderr, "vPortSystemTickHandler called from non-FreeRTOS thread\n" );
}
}
/*-----------------------------------------------------------*/