The std::atomic in C programming is Nios® II software development is not supported. The Nios® II GCC compiler is running by default with this feature "Thread Model: single", and cannot be modified.
Nios® II does not have any atomic instructions. Hence, the "Thread Model: single" is the default setting for the compiler.
To overcome this issue, Altera recommends using the Avalon Mutex Core, which gives Nios II the atomic operation. This document (Chapter 11) provides more information about this IP.
https://www.altera.com/en_US/pdfs/literature/ug/ug_embedded_ip.pdf