[C++] simple atomics with memory order
\nclass Foo {\npublic:\n    Foo() {\n        \n    }\n\n    void first(function<void()> printFirst) {\n        printFirst();\n        a1.store(true, memory_orde
```\nclass Foo {\npublic:\n    Foo() {\n        \n    }\n\n    void first(function<void()> printFirst) {\n        printFirst();\n        a1.store(true, memory_order_release);\n    }\n\n    void second(function<void()> printSecond) {\n        while(!a1.load(std::memory_order_acquire)) this_thread::yield();\n        printSecond();\n        a2.store(true, memory_order_release);\n    }\n\n    void third(function<void()> printThird) {\n        while(!a2.load(std::memory_order_acquire)) this_thread::yield();\n        printThird();\n    }\nprivate:\n    atomic<bool> a1{false};\n    atomic<bool> a2{false};\n};\n```
['C']