[2.0.x] fix possible race condition#11923
[2.0.x] fix possible race condition#11923thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom GMagician:2.0.x-revert-parts-of-endstop-bugfix
Conversation
|
What makes you think this fixes a race condition? |
|
If reset variable order is not correct you may reset first live but in meantime a temp isr may be executed and live may be updated (count is 1) and after interrupt you reset count (already 0 because of interrupt). |
|
Are you sure that the order is reversed by the existing syntax? I would expect them to be set to zero in the given order, first |
|
Apparently it does. I'd've expected the standard to be less formal and simply make it equivalent, but in strict mode the compiler will be more literal about it. |
Fix some commits done in #11900
|
Not sure but I think is compiler dependent (depending on optimizations) |
From my memory with x86 C I remember that order is from right to left but not sure if optimizations don't change (don't know if this is strictly ruled) |
|
Yep, that's the same post I found before posting "Apparently it does…" |
Fix some commits done in #11900