mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 17:17:44 -04:00
Posix: just assert if a task returned from its main function
This commit is contained in:
parent
30d95176a7
commit
7f0cad3979
1 changed files with 6 additions and 20 deletions
26
portable/ThirdParty/GCC/Posix/port.c
vendored
26
portable/ThirdParty/GCC/Posix/port.c
vendored
|
@ -417,24 +417,6 @@ Thread_t *pxThreadToCancel = prvGetThreadFromTask( pxTaskToDelete );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void prvTaskExitError( void )
|
|
||||||
{
|
|
||||||
/* A function that implements a task must not exit or attempt to return to
|
|
||||||
* its caller as there is nothing to return to. If a task wants to exit it
|
|
||||||
* should instead call vTaskDelete( NULL ). Artificially force an assert()
|
|
||||||
* to be triggered if configASSERT() is defined, then stop here so
|
|
||||||
* application writers can catch the error. */
|
|
||||||
configASSERT( pdFALSE );
|
|
||||||
|
|
||||||
portDISABLE_INTERRUPTS();
|
|
||||||
|
|
||||||
while( 1 )
|
|
||||||
{
|
|
||||||
/* Do Nothing */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
static void *prvWaitForStart( void * pvParams )
|
static void *prvWaitForStart( void * pvParams )
|
||||||
{
|
{
|
||||||
Thread_t *pxThread = pvParams;
|
Thread_t *pxThread = pvParams;
|
||||||
|
@ -448,8 +430,12 @@ Thread_t *pxThread = pvParams;
|
||||||
/* Call the task's entry point. */
|
/* Call the task's entry point. */
|
||||||
pxThread->pxCode( pxThread->pvParams );
|
pxThread->pxCode( pxThread->pvParams );
|
||||||
|
|
||||||
/* Task function should not return */
|
/* A function that implements a task must not exit or attempt to return to
|
||||||
prvTaskExitError();
|
* its caller as there is nothing to return to. If a task wants to exit it
|
||||||
|
* should instead call vTaskDelete( NULL ). Artificially force an assert()
|
||||||
|
* to be triggered if configASSERT() is defined, so application writers can
|
||||||
|
* catch the error. */
|
||||||
|
configASSERT( pdFALSE );
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue