mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 00:57:44 -04:00
Posix: Free the condition variable memory in the correct place
In case of deleting a task from another task, the deletion happens immediately and the thread is canceled but the memory allocated by the task condition variable is not freed. This causes the memory checkers (Valgrind, Address sanitizers, ..) to complain.
This commit is contained in:
parent
e9a2d2701e
commit
1965a90613
1 changed files with 1 additions and 1 deletions
2
portable/ThirdParty/GCC/Posix/port.c
vendored
2
portable/ThirdParty/GCC/Posix/port.c
vendored
|
@ -411,6 +411,7 @@ Thread_t *pxThreadToCancel = prvGetThreadFromTask( pxTaskToDelete );
|
|||
*/
|
||||
pthread_cancel( pxThreadToCancel->pthread );
|
||||
pthread_join( pxThreadToCancel->pthread, NULL );
|
||||
event_delete( pxThreadToCancel->ev );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -450,7 +451,6 @@ BaseType_t uxSavedCriticalNesting;
|
|||
prvResumeThread( pxThreadToResume );
|
||||
if ( pxThreadToSuspend->xDying )
|
||||
{
|
||||
event_delete(pxThreadToSuspend->ev);
|
||||
pthread_exit( NULL );
|
||||
}
|
||||
prvSuspendSelf( pxThreadToSuspend );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue