Skip to content

Commit 8644a2c

Browse files
committed
[atomics.syn], [atomics.flag] Clean up presentation around
ATOMIC_FLAG_INIT. * Add some vertical whitespace in description of atomic_flag operations. * Reorder ATOMIC_FLAG_INIT earlier in synopsis for consistency. * Add proper item description for ATOMIC_FLAG_INIT. * Remove repetition of declarations of atomic_flag non-member functions and the ATOMIC_FLAG_INIT macro from [atomics.flag].
1 parent 63928ee commit 8644a2c

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

source/atomics.tex

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
// \ref{atomics.types.pointer}, partial specialization for pointers
5757
template<class T> struct atomic<T*>;
5858

59+
// \ref{atomics.types.operations}, initialization
60+
#define ATOMIC_VAR_INIT(value) @\seebelow@
61+
5962
// \ref{atomics.nonmembers}, non-member functions
6063
template<class T>
6164
bool atomic_is_lock_free(const volatile atomic<T>*) noexcept;
@@ -200,9 +203,6 @@
200203
template<class T>
201204
void atomic_notify_all(atomic<T>*);
202205

203-
// \ref{atomics.types.operations}, initialization
204-
#define ATOMIC_VAR_INIT(value) @\seebelow@
205-
206206
// \ref{atomics.alias}, type aliases
207207
using atomic_bool = atomic<bool>;
208208
using atomic_char = atomic<char>;
@@ -260,6 +260,9 @@
260260

261261
// \ref{atomics.flag}, flag type and operations
262262
struct atomic_flag;
263+
264+
#define ATOMIC_FLAG_INIT @\seebelow@
265+
263266
bool atomic_flag_test(const volatile atomic_flag*) noexcept;
264267
bool atomic_flag_test(const atomic_flag*) noexcept;
265268
bool atomic_flag_test_explicit(const volatile atomic_flag*, memory_order) noexcept;
@@ -272,6 +275,7 @@
272275
void atomic_flag_clear(atomic_flag*) noexcept;
273276
void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order) noexcept;
274277
void atomic_flag_clear_explicit(atomic_flag*, memory_order) noexcept;
278+
275279
void atomic_flag_wait(const volatile atomic_flag*, bool) noexcept;
276280
void atomic_flag_wait(const atomic_flag*, bool) noexcept;
277281
void atomic_flag_wait_explicit(const volatile atomic_flag*,
@@ -282,7 +286,6 @@
282286
void atomic_flag_notify_one(atomic_flag*) noexcept;
283287
void atomic_flag_notify_all(volatile atomic_flag*) noexcept;
284288
void atomic_flag_notify_all(atomic_flag*) noexcept;
285-
#define ATOMIC_FLAG_INIT @\seebelow@
286289

287290
// \ref{atomics.fences}, fences
288291
extern "C" void atomic_thread_fence(memory_order) noexcept;
@@ -2628,32 +2631,6 @@
26282631
atomic_flag& operator=(const atomic_flag&) = delete;
26292632
atomic_flag& operator=(const atomic_flag&) volatile = delete;
26302633
};
2631-
2632-
bool atomic_flag_test(const volatile atomic_flag*) noexcept;
2633-
bool atomic_flag_test(const atomic_flag*) noexcept;
2634-
bool atomic_flag_test_explicit(const volatile atomic_flag*, memory_order) noexcept;
2635-
bool atomic_flag_test_explicit(const atomic_flag*, memory_order) noexcept;
2636-
bool atomic_flag_test_and_set(volatile atomic_flag*) noexcept;
2637-
bool atomic_flag_test_and_set(atomic_flag*) noexcept;
2638-
bool atomic_flag_test_and_set_explicit(volatile atomic_flag*, memory_order) noexcept;
2639-
bool atomic_flag_test_and_set_explicit(atomic_flag*, memory_order) noexcept;
2640-
void atomic_flag_clear(volatile atomic_flag*) noexcept;
2641-
void atomic_flag_clear(atomic_flag*) noexcept;
2642-
void atomic_flag_clear_explicit(volatile atomic_flag*, memory_order) noexcept;
2643-
void atomic_flag_clear_explicit(atomic_flag*, memory_order) noexcept;
2644-
2645-
void atomic_flag_wait(const volatile atomic_flag*, bool) noexcept;
2646-
void atomic_flag_wait(const atomic_flag*, bool) noexcept;
2647-
void atomic_flag_wait_explicit(const volatile atomic_flag*,
2648-
bool, memory_order) noexcept;
2649-
void atomic_flag_wait_explicit(const atomic_flag*,
2650-
bool, memory_order) noexcept;
2651-
void atomic_flag_notify_one(volatile atomic_flag*) noexcept;
2652-
void atomic_flag_notify_one(atomic_flag*) noexcept;
2653-
void atomic_flag_notify_all(volatile atomic_flag*) noexcept;
2654-
void atomic_flag_notify_all(atomic_flag*) noexcept;
2655-
2656-
#define ATOMIC_FLAG_INIT @\seebelow@
26572634
}
26582635
\end{codeblock}
26592636

@@ -2668,7 +2645,14 @@
26682645
The \tcode{atomic_flag} type is a standard-layout struct.
26692646
It has a trivial default constructor and a trivial destructor.
26702647

2648+
\indexlibrary{\idxcode{ATOMIC_FLAG_INIT}}%
2649+
\begin{itemdecl}
2650+
#define ATOMIC_FLAG_INIT @\seebelow@
2651+
\end{itemdecl}
2652+
2653+
\begin{itemdescr}
26712654
\pnum
2655+
\remarks
26722656
The macro \tcode{ATOMIC_FLAG_INIT} shall be defined in such a way that it can be used to initialize an object of type \tcode{atomic_flag} to the
26732657
clear state. The macro can be used in the form:
26742658
\begin{codeblock}
@@ -2678,6 +2662,7 @@
26782662
For a complete static-duration object, that initialization shall be static.
26792663
Unless initialized with \tcode{ATOMIC_FLAG_INIT}, it is unspecified whether an
26802664
\tcode{atomic_flag} object has an initial state of set or clear.
2665+
\end{itemdescr}
26812666

26822667
\indexlibrary{\idxcode{atomic_flag_test}}%
26832668
\indexlibrary{\idxcode{atomic_flag_test_explicit}}%

0 commit comments

Comments
 (0)