Change the Win32 port layer so it doesn't use the traceTASK_DELETE macro, but instead the new portCLEAN_UP_TCB macro.
diff --git a/Source/portable/MSVC-MingW/port.c b/Source/portable/MSVC-MingW/port.c
index 55d2ebe..b4d32f2 100644
--- a/Source/portable/MSVC-MingW/port.c
+++ b/Source/portable/MSVC-MingW/port.c
@@ -1,5 +1,5 @@
/*
- FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
+ FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.
***************************************************************************
@@ -77,7 +77,6 @@
* Interrupt handlers used by the kernel itself. These are executed from the
* simulated interrupt handler thread.
*/
-static unsigned long prvProcessDeleteThreadInterrupt( void );
static unsigned long prvProcessYieldInterrupt( void );
static unsigned long prvProcessTickInterrupt( void );
@@ -150,7 +149,7 @@
{
Sleep( portTICK_RATE_MS );
}
-
+
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
/* The timer has expired, generate the simulated tick event. */
@@ -204,7 +203,6 @@
/* Install the interrupt handlers used by the scheduler itself. */
vPortSetInterruptHandler( portINTERRUPT_YIELD, prvProcessYieldInterrupt );
vPortSetInterruptHandler( portINTERRUPT_TICK, prvProcessTickInterrupt );
- vPortSetInterruptHandler( portINTERRUPT_DELETE_THREAD, prvProcessDeleteThreadInterrupt );
/* Create the events and mutexes that are used to synchronise all the
threads. */
@@ -270,12 +268,6 @@
}
/*-----------------------------------------------------------*/
-static unsigned long prvProcessDeleteThreadInterrupt( void )
-{
- return pdTRUE;
-}
-/*-----------------------------------------------------------*/
-
static unsigned long prvProcessYieldInterrupt( void )
{
return pdTRUE;
@@ -361,15 +353,7 @@
{
/* Suspend the old thread. */
pxThreadState = ( xThreadState *) *( ( unsigned long * ) pvOldCurrentTCB );
-
- if( ( ulSwitchRequired & ( 1 << portINTERRUPT_DELETE_THREAD ) ) != pdFALSE )
- {
- TerminateThread( pxThreadState->pvThread, 0 );
- }
- else
- {
- SuspendThread( pxThreadState->pvThread );
- }
+ SuspendThread( pxThreadState->pvThread );
/* Obtain the state of the task now selected to enter the
Running state. */
@@ -387,23 +371,13 @@
{
xThreadState *pxThreadState;
- if( pvTaskToDelete == pxCurrentTCB )
- {
- /* The task is deleting itself, and so the thread that is running now
- is also to be deleted. This has to be deferred until this thread is
- no longer running, so its done in the simulated interrupt handler thread. */
- vPortGenerateSimulatedInterrupt( portINTERRUPT_DELETE_THREAD );
- }
- else
- {
- WaitForSingleObject( pvInterruptEventMutex, INFINITE );
+ WaitForSingleObject( pvInterruptEventMutex, INFINITE );
- /* Find the handle of the thread being deleted. */
- pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
- TerminateThread( pxThreadState->pvThread, 0 );
+ /* Find the handle of the thread being deleted. */
+ pxThreadState = ( xThreadState * ) ( *( unsigned long *) pvTaskToDelete );
+ TerminateThread( pxThreadState->pvThread, 0 );
- ReleaseMutex( pvInterruptEventMutex );
- }
+ ReleaseMutex( pvInterruptEventMutex );
}
/*-----------------------------------------------------------*/
diff --git a/Source/portable/MSVC-MingW/portmacro.h b/Source/portable/MSVC-MingW/portmacro.h
index c8529e1..5e7bf68 100644
--- a/Source/portable/MSVC-MingW/portmacro.h
+++ b/Source/portable/MSVC-MingW/portmacro.h
@@ -1,5 +1,5 @@
/*
- FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
+ FreeRTOS V7.1.1-rc1 - Copyright (C) 2011 Real Time Engineers Ltd.
***************************************************************************
@@ -84,7 +84,7 @@
#define portYIELD() vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )
void vPortDeleteThread( void *pvThreadToDelete );
-#define traceTASK_DELETE( pxTCB ) vPortDeleteThread( pxTCB )
+#define portCLEAN_UP_TCB( pxTCB ) vPortDeleteThread( pxTCB )
#define portDISABLE_INTERRUPTS()
#define portENABLE_INTERRUPTS()
@@ -102,7 +102,6 @@
#define portINTERRUPT_YIELD ( 0UL )
#define portINTERRUPT_TICK ( 1UL )
-#define portINTERRUPT_DELETE_THREAD ( 2UL )
/*
* Raise a simulated interrupt represented by the bit mask in ulInterruptMask.