Use std::atomic.
Use template'd typedef.