Not an expert, but can’t you get synchronization like this just by using release/acquire memory order with C11 atomic stores and loads?
Yes. But if you are tempted to do this in most cases you should just use a mutex anyway.
Yes. But if you are tempted to do this in most cases you should just use a mutex anyway.