use C++11 atomics