mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 00:57:44 -04:00
Posix: End Timer thread and free its resources after ending the scheduler
This commit is contained in:
parent
1965a90613
commit
e98ea9ef66
1 changed files with 6 additions and 4 deletions
10
portable/ThirdParty/GCC/Posix/port.c
vendored
10
portable/ThirdParty/GCC/Posix/port.c
vendored
|
@ -62,6 +62,7 @@
|
|||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "timers.h"
|
||||
#include "utils/wait_for_event.h"
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -178,7 +179,6 @@ portBASE_TYPE xPortStartScheduler( void )
|
|||
{
|
||||
int iSignal;
|
||||
sigset_t xSignals;
|
||||
TaskHandle_t pxIdleThread;
|
||||
|
||||
hMainThread = pthread_self();
|
||||
|
||||
|
@ -186,8 +186,6 @@ TaskHandle_t pxIdleThread;
|
|||
Interrupts are disabled here already. */
|
||||
prvSetupTimerInterrupt();
|
||||
|
||||
pxIdleThread = xTaskGetIdleTaskHandle();
|
||||
|
||||
/* Start the first task. */
|
||||
vPortStartFirstTask();
|
||||
|
||||
|
@ -201,7 +199,11 @@ TaskHandle_t pxIdleThread;
|
|||
}
|
||||
|
||||
/* Cancel the Idle task and free its resources */
|
||||
vPortCancelThread(pxIdleThread);
|
||||
vPortCancelThread( xTaskGetIdleTaskHandle() );
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
/* Cancel the Timer task and free its resources */
|
||||
vPortCancelThread( xTimerGetTimerDaemonTaskHandle() );
|
||||
#endif /* configUSE_TIMERS */
|
||||
|
||||
/* Restore original signal mask. */
|
||||
(void)pthread_sigmask( SIG_SETMASK, &xSchedulerOriginalSignalMask, NULL );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue