\r
void vTaskSuspendAll( void )\r
{\r
\r
void vTaskSuspendAll( void )\r
{\r
- portENTER_CRITICAL();\r
- ++uxSchedulerSuspended;\r
- portEXIT_CRITICAL();\r
+ /* A critical section is not required as the variable is of type\r
+ portBASE_TYPE. */\r
+ ++uxSchedulerSuspended;\r
}\r
/*----------------------------------------------------------*/\r
\r
}\r
/*----------------------------------------------------------*/\r
\r
\r
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )\r
{\r
\r
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )\r
{\r
-unsigned portBASE_TYPE uxNumberOfTasks;\r
-\r
- taskENTER_CRITICAL();\r
- uxNumberOfTasks = uxCurrentNumberOfTasks;\r
- taskEXIT_CRITICAL();\r
-\r
- return uxNumberOfTasks;\r
+ /* A critical section is not required because the variables are of type\r
+ portBASE_TYPE. */\r
+ return uxCurrentNumberOfTasks;\r
}\r
/*-----------------------------------------------------------*/\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
xTCB = ( tskTCB * ) xTask;\r
}\r
\r
xTCB = ( tskTCB * ) xTask;\r
}\r
\r
- /* Save the hook function in the TCB. */\r
+ /* Save the hook function in the TCB. A critical section is required as\r
+ the value can be accessed from an interrupt. */\r
portENTER_CRITICAL();\r
xTCB->pxTaskTag = pxTagValue;\r
portEXIT_CRITICAL();\r
portENTER_CRITICAL();\r
xTCB->pxTaskTag = pxTagValue;\r
portEXIT_CRITICAL();\r
\r
xTaskHandle xTaskGetCurrentTaskHandle( void )\r
{\r
\r
xTaskHandle xTaskGetCurrentTaskHandle( void )\r
{\r
- xTaskHandle xReturn;\r
-\r
- portENTER_CRITICAL();\r
- {\r
- xReturn = ( xTaskHandle ) pxCurrentTCB;\r
- }\r
- portEXIT_CRITICAL();\r
-\r
- return xReturn;\r
+ /* A critical section is not required as this is not called from\r
+ an interrupt and the current TCB will always be the same for any\r
+ individual execution thread. */\r
+ return pxCurrentTCB;\r