]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/MSVC-MingW/port.c
Change the way one thread deletes another in the Windows simulator port (the way...
[freertos] / FreeRTOS / Source / portable / MSVC-MingW / port.c
index 8e8e82d5f9e8242c060f5f184fc5022ca929f915..bfd651373eb3717ec09f8fcc13a584ec5d99a0ef 100644 (file)
@@ -418,6 +418,10 @@ void *pvObjectList[ 2 ];
 void vPortDeleteThread( void *pvTaskToDelete )\r
 {\r
 xThreadState *pxThreadState;\r
+unsigned long ulErrorCode;\r
+\r
+       /* Remove compiler warnings if configASSERT() is not defined. */\r
+       ( void ) ulErrorCode;\r
 \r
        /* Find the handle of the thread being deleted. */\r
        pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );\r
@@ -430,8 +434,11 @@ xThreadState *pxThreadState;
        {\r
                WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
 \r
-               CloseHandle( pxThreadState->pvThread );\r
-               TerminateThread( pxThreadState->pvThread, 0 );\r
+               ulErrorCode = TerminateThread( pxThreadState->pvThread, 0 );\r
+               configASSERT( ulErrorCode );\r
+\r
+               ulErrorCode = CloseHandle( pxThreadState->pvThread );\r
+               configASSERT( ulErrorCode );\r
 \r
                ReleaseMutex( pvInterruptEventMutex );\r
        }\r
@@ -442,6 +449,10 @@ void vPortCloseRunningThread( void *pvTaskToDelete, volatile portBASE_TYPE *pxPe
 {\r
 xThreadState *pxThreadState;\r
 void *pvThread;\r
+unsigned long ulErrorCode;\r
+\r
+       /* Remove compiler warnings if configASSERT() is not defined. */\r
+       ( void ) ulErrorCode;\r
 \r
        /* Find the handle of the thread being deleted. */\r
        pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );\r
@@ -462,7 +473,9 @@ void *pvThread;
        pxThreadState->pvThread = NULL;\r
 \r
        /* Close the thread. */\r
-       CloseHandle( pvThread );\r
+       ulErrorCode = CloseHandle( pvThread );\r
+       configASSERT( ulErrorCode );\r
+\r
        ExitThread( 0 );\r
 }\r
 /*-----------------------------------------------------------*/\r