std::atomic_init
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> template< class T > void atomic_init( std::atomic<T>* obj, T desired ); |
||
template< class T > void atomic_init( volatile std::atomic<T>* obj, T desired ); |
||
-
object desired. : , , . :
Initializes the default-constructed atomic object
object with the value desired. The function is not atomic: concurrent access from another thread, even through an atomic operation, is a data race. obj -, .obj, .| obj | ||
| desired |
()
noexcept:
noexcept . , std::atomic .
:
This function is provided for compatibility with C. If the compatibility is not required, std::atomic may be initialized through their non-default constructors.
| : |
.
(C++11)( C++20) |
(-) |
| (public - std::atomic)
| |
C atomic_init
| |