32
Concurrency support library
[thread]
32.6
Mutual exclusion
[thread.mutex]
32.6.7
Call once
[thread.once]
32.6.7.1
Struct
once_
flag
[thread.once.onceflag]
🔗
namespace
std
{
struct
once_flag
{
constexpr
once_flag
(
)
noexcept
; once_flag
(
const
once_flag
&
)
=
delete
; once_flag
&
operator
=
(
const
once_flag
&
)
=
delete
;
}
;
}
1
#
The class
once_
flag
is an opaque data structure that
call_
once
uses to initialize data without causing a data race or deadlock
.
🔗
constexpr
once_flag
(
)
noexcept
;
2
#
Synchronization
: The construction of a
once_
flag
object is not synchronized
.
3
#
Postconditions
: The object's internal state is set to indicate to an invocation of
call_
once
with the object as its initial argument that no function has been called
.