Merge branch 'master' into fix_posix_no_switching_after_task_ended

This commit is contained in:
alfred gedeon 2020-09-29 14:07:30 -07:00 committed by GitHub
commit dbae07626f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,6 +62,7 @@
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "utils/wait_for_event.h"
/*-----------------------------------------------------------*/
@ -198,6 +199,13 @@ sigset_t xSignals;
sigwait( &xSignals, &iSignal );
}
/* Cancel the Idle task and free its resources */
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 );
@ -406,6 +414,7 @@ Thread_t *pxThreadToCancel = prvGetThreadFromTask( pxTaskToDelete );
*/
pthread_cancel( pxThreadToCancel->pthread );
pthread_join( pxThreadToCancel->pthread, NULL );
event_delete( pxThreadToCancel->ev );
}
/*-----------------------------------------------------------*/
@ -453,7 +462,6 @@ BaseType_t uxSavedCriticalNesting;
prvResumeThread( pxThreadToResume );
if ( pxThreadToSuspend->xDying )
{
event_delete(pxThreadToSuspend->ev);
pthread_exit( NULL );
}
prvSuspendSelf( pxThreadToSuspend );