]> git.sur5r.net Git - freertos/commitdiff
Change the Win32 port layer so it doesn't use the traceTASK_DELETE macro, but instead...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 24 Apr 2012 13:09:22 +0000 (13:09 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 24 Apr 2012 13:09:22 +0000 (13:09 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1745 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/MSVC-MingW/port.c
Source/portable/MSVC-MingW/portmacro.h

index 55d2ebe3c3ddaf410e0a3449e9f321a5b881e079..b4d32f2705dbaa1e2edcd53836c3b415a6d759a2 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+    FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
        \r
 \r
     ***************************************************************************\r
@@ -77,7 +77,6 @@ static void prvProcessSimulatedInterrupts( void );
  * Interrupt handlers used by the kernel itself.  These are executed from the\r
  * simulated interrupt handler thread.\r
  */\r
-static unsigned long prvProcessDeleteThreadInterrupt( void );\r
 static unsigned long prvProcessYieldInterrupt( void );\r
 static unsigned long prvProcessTickInterrupt( void );\r
 \r
@@ -150,7 +149,7 @@ portTickType xMinimumWindowsBlockTime = ( portTickType ) 20;
                {\r
                        Sleep( portTICK_RATE_MS );\r
                }\r
-       \r
+\r
                WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
 \r
                /* The timer has expired, generate the simulated tick event. */\r
@@ -204,7 +203,6 @@ xThreadState *pxThreadState;
        /* Install the interrupt handlers used by the scheduler itself. */\r
        vPortSetInterruptHandler( portINTERRUPT_YIELD, prvProcessYieldInterrupt );\r
        vPortSetInterruptHandler( portINTERRUPT_TICK, prvProcessTickInterrupt );\r
-       vPortSetInterruptHandler( portINTERRUPT_DELETE_THREAD, prvProcessDeleteThreadInterrupt );\r
 \r
        /* Create the events and mutexes that are used to synchronise all the\r
        threads. */\r
@@ -270,12 +268,6 @@ xThreadState *pxThreadState;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static unsigned long prvProcessDeleteThreadInterrupt( void )\r
-{\r
-       return pdTRUE;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 static unsigned long prvProcessYieldInterrupt( void )\r
 {\r
        return pdTRUE;\r
@@ -361,15 +353,7 @@ void *pvObjectList[ 2 ];
                        {\r
                                /* Suspend the old thread. */\r
                                pxThreadState = ( xThreadState *) *( ( unsigned long * ) pvOldCurrentTCB );\r
-\r
-                               if( ( ulSwitchRequired & ( 1 << portINTERRUPT_DELETE_THREAD ) ) != pdFALSE )\r
-                               {\r
-                                       TerminateThread( pxThreadState->pvThread, 0 );\r
-                               }\r
-                               else\r
-                               {\r
-                                       SuspendThread( pxThreadState->pvThread );\r
-                               }                                                       \r
+                               SuspendThread( pxThreadState->pvThread );\r
 \r
                                /* Obtain the state of the task now selected to enter the \r
                                Running state. */\r
@@ -387,23 +371,13 @@ void vPortDeleteThread( void *pvTaskToDelete )
 {\r
 xThreadState *pxThreadState;\r
 \r
-       if( pvTaskToDelete == pxCurrentTCB )\r
-       {\r
-               /* The task is deleting itself, and so the thread that is running now\r
-               is also to be deleted.  This has to be deferred until this thread is\r
-               no longer running, so its done in the simulated interrupt handler thread. */\r
-               vPortGenerateSimulatedInterrupt( portINTERRUPT_DELETE_THREAD );\r
-       }\r
-       else\r
-       {\r
-               WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
+       WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
 \r
-               /* Find the handle of the thread being deleted. */\r
-               pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );\r
-               TerminateThread( pxThreadState->pvThread, 0 );\r
+       /* Find the handle of the thread being deleted. */\r
+       pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );\r
+       TerminateThread( pxThreadState->pvThread, 0 );\r
 \r
-               ReleaseMutex( pvInterruptEventMutex );\r
-       }\r
+       ReleaseMutex( pvInterruptEventMutex );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index c8529e156d1390ef72575828e4fea95987112333..5e7bf688c14ec28ab1511a7b1f274bc59c733c5f 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+    FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
        \r
 \r
     ***************************************************************************\r
@@ -84,7 +84,7 @@
 #define portYIELD()                                    vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )\r
 \r
 void vPortDeleteThread( void *pvThreadToDelete );\r
-#define traceTASK_DELETE( pxTCB )      vPortDeleteThread( pxTCB )\r
+#define portCLEAN_UP_TCB( pxTCB )      vPortDeleteThread( pxTCB )\r
 #define portDISABLE_INTERRUPTS()\r
 #define portENABLE_INTERRUPTS()\r
 \r
@@ -102,7 +102,6 @@ void vPortExitCritical( void );
 \r
 #define portINTERRUPT_YIELD                            ( 0UL )\r
 #define portINTERRUPT_TICK                             ( 1UL )\r
-#define portINTERRUPT_DELETE_THREAD            ( 2UL )\r
 \r
 /* \r
  * Raise a simulated interrupt represented by the bit mask in ulInterruptMask.\r