Made use of std::atomic-s.