/*\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
* 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
{\r
Sleep( portTICK_RATE_MS );\r
}\r
- \r
+\r
WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
\r
/* The timer has expired, generate the simulated tick event. */\r
/* 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
}\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
{\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
{\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
/*\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
#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
\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