Hello Karol:
"Poor mans mutex". Since the Syngery processor is native 32 bit and you use a 32 bit variable aligned (default) on a 4 byte address all reads and writes to this variable should be one machine instruction. Therefore it is impossible for another thread or any interrupt to corrupt the variable in the middle of a read or write making this variable inherently thread safe.
Regards,
Steve Dillier