mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -04:00
Change the way one thread deletes another in the Windows simulator port (the way one thread deleted itself was already changed in a previous check-in).
Reset the expected block time variable when a task is suspended or deleted in case the value held in the variables was associated with the task just suspended or deleted.
This commit is contained in:
parent
0d1e12522b
commit
acad916453
4 changed files with 86 additions and 56 deletions
|
@ -418,6 +418,10 @@ void *pvObjectList[ 2 ];
|
|||
void vPortDeleteThread( void *pvTaskToDelete )
|
||||
{
|
||||
xThreadState *pxThreadState;
|
||||
unsigned long ulErrorCode;
|
||||
|
||||
/* Remove compiler warnings if configASSERT() is not defined. */
|
||||
( void ) ulErrorCode;
|
||||
|
||||
/* Find the handle of the thread being deleted. */
|
||||
pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
|
||||
|
@ -430,8 +434,11 @@ xThreadState *pxThreadState;
|
|||
{
|
||||
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
||||
|
||||
CloseHandle( pxThreadState->pvThread );
|
||||
TerminateThread( pxThreadState->pvThread, 0 );
|
||||
ulErrorCode = TerminateThread( pxThreadState->pvThread, 0 );
|
||||
configASSERT( ulErrorCode );
|
||||
|
||||
ulErrorCode = CloseHandle( pxThreadState->pvThread );
|
||||
configASSERT( ulErrorCode );
|
||||
|
||||
ReleaseMutex( pvInterruptEventMutex );
|
||||
}
|
||||
|
@ -442,6 +449,10 @@ void vPortCloseRunningThread( void *pvTaskToDelete, volatile portBASE_TYPE *pxPe
|
|||
{
|
||||
xThreadState *pxThreadState;
|
||||
void *pvThread;
|
||||
unsigned long ulErrorCode;
|
||||
|
||||
/* Remove compiler warnings if configASSERT() is not defined. */
|
||||
( void ) ulErrorCode;
|
||||
|
||||
/* Find the handle of the thread being deleted. */
|
||||
pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
|
||||
|
@ -462,7 +473,9 @@ void *pvThread;
|
|||
pxThreadState->pvThread = NULL;
|
||||
|
||||
/* Close the thread. */
|
||||
CloseHandle( pvThread );
|
||||
ulErrorCode = CloseHandle( pvThread );
|
||||
configASSERT( ulErrorCode );
|
||||
|
||||
ExitThread( 0 );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue