On constrained devices, I often find myself \"faking\" locks between 2 threads with 2 bools. Each is only read by one thread, and only written by the other. Here\'s what I m
Unless you understand the memory architecture of your device in detail, as well as the code generated by your compiler, this code is not safe.
Just because it seems that it would work, doesn't mean that it will. "Constrained" devices, like the unconstrained type, are getting more and more powerful. I wouldn't bet against finding a dual-core CPU in a cell phone, for instance. That means I wouldn't bet that the above code would work.