Ensure the atomic<> objects are handled correctly

Upcoming MR will be more explicit

Also will replace boost::atomic with std::atomic.