std::atomic is a class template in the C++11 Standard Library which provides atomic operations.
I have a simple boolean value I need to test and set in a thread-safe manner. If one thread is …