I was comparing the latest FreeROTS version (6.0.2) and an earlier one (version 4.4.0). Here’s what puzzles me:
In file tasks.c, function vTaskSuspendAll(), the statement “++uxSchedulerSuspended;” was protected by a critical section in version 4.4.0. While in 6.0.2, it is not, and the comment in 6.0.2 gave the rationale: “A critical section is not required as the variable is of type portBASE_TYPE.”
I’m confused - even if the variable is a base type, the “++” essentially is still a load-increment-store. If the current process got interrupted right between “load” and “increment”, and preempted by another process which also calls this same function, the race condition is still there and would cause an error.
Am I missing something here?
Thanks in advance.