Skip to content

Commit 3884ce6

Browse files
committed
Revert "Add macro taskTASK_IS_RUNNING_OR_YIELDING"
This reverts commit 8e898b7.
1 parent ea9a44f commit 3884ce6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tasks.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,9 @@ typedef BaseType_t TaskRunning_t;
276276

277277
/* Returns pdTRUE if the task is actively running and not scheduled to yield. */
278278
#if ( configNUMBER_OF_CORES == 1 )
279-
#define taskTASK_IS_RUNNING( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( pdTRUE ) : ( pdFALSE ) )
280-
#define taskTASK_IS_RUNNING_OR_YIELDING( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( pdTRUE ) : ( pdFALSE ) )
279+
#define taskTASK_IS_RUNNING( pxTCB ) ( ( ( pxTCB ) == pxCurrentTCB ) ? ( pdTRUE ) : ( pdFALSE ) )
281280
#else
282-
#define taskTASK_IS_RUNNING( pxTCB ) ( ( ( ( pxTCB )->xTaskRunState >= ( BaseType_t ) 0 ) && ( ( pxTCB )->xTaskRunState < ( BaseType_t ) configNUMBER_OF_CORES ) ) ? ( pdTRUE ) : ( pdFALSE ) )
283-
#define taskTASK_IS_RUNNING_OR_YIELDING( pxTCB ) ( ( ( pxTCB )->xTaskRunState != taskTASK_NOT_RUNNING ) ? ( pdTRUE ) : ( pdFALSE ) )
281+
#define taskTASK_IS_RUNNING( pxTCB ) ( ( ( ( pxTCB )->xTaskRunState >= ( BaseType_t ) 0 ) && ( ( pxTCB )->xTaskRunState < ( BaseType_t ) configNUMBER_OF_CORES ) ) ? ( pdTRUE ) : ( pdFALSE ) )
284282
#endif
285283

286284
/* Indicates that the task is an Idle task. */
@@ -1927,7 +1925,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
19271925
/* If the task is running (or yielding), we must add it to the
19281926
* termination list so that an idle task can delete it when it is
19291927
* no longer running. */
1930-
if( taskTASK_IS_RUNNING_OR_YIELDING( pxTCB ) != pdFALSE )
1928+
#if ( configNUMBER_OF_CORES == 1 )
1929+
if( pxTCB == pxCurrentTCB )
1930+
#else
1931+
if( pxTCB->xTaskRunState != taskTASK_NOT_RUNNING )
1932+
#endif
19311933
{
19321934
/* A running task is being deleted. This cannot complete within the
19331935
* task itself, as a context switch to another task is required.

0 commit comments

Comments
 (0)