FreeRTOS(FreeRTOSV7.4.0 \ FreeRTOS \ Source \ tasks.c)でいくつかのコードを見つけました:
void vTaskSuspendAll( void )
{
/* A critical section is not required as the variable is of type
portBASE_TYPE. */
++uxSchedulerSuspended;
}
タイプが「長い」タイプである「portBASE_TYPE」であるため、保護する必要がないと明示的に言われています。私の理解では、このタイプへの自己インクリメントはアトミックであると想定しています。しかし、それを分解した後、私は証拠を見つけることができませんでした、それは単純なロード->追加->ストアです。それでは問題ですか?
void vTaskSuspendAll( void )
{
/* A critical section is not required as the variable is of type
portBASE_TYPE. */
++uxSchedulerSuspended;
4dc: 4b03 ldr r3, [pc, #12] ; (4ec <vTaskSuspendAll+0x10>)
4de: f8d3 2118 ldr.w r2, [r3, #280] ; 0x118
4e2: 1c50 adds r0, r2, #1
4e4: f8c3 0118 str.w r0, [r3, #280] ; 0x118
4e8: 4770 bx lr
4ea: bf00 nop
4ec: 00000000 .word 0x00000000
000004f0 <xTaskGetTickCount>:
return xAlreadyYielded;
}