Hello,
Does following code ensure memory access ordering:
int value;
void test() {
taskENTER_CRITICAL();
value += 1;
taskEXIT_CRITICAL();
}
since taskEXIT_CRITICAL()
(vPortSetBASEPRI()
) does not include any of the DMB
, DSB
instructions. (Let’s assume global value
is then usded/modified within interrupt handler that would be disabled by portDISABLE_INTERRUPTS()
. Also I am specifically considering ARM_CM4F port variant.)
Am I supposed to use my own/3rd party code (like C++’ std::atomic<T>
) to ensure so? If so, is that mentioned somewhere in FreeRTOS’ documentation?
Thank you.
Best Regards,
Stefan Misik