From de60e17cfa45840d871b545bbd3867d3afd5ee27 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 12:13:59 +0800 Subject: [PATCH 01/13] [thread.jthread.class] Exposition-only style for `ssource` --- source/threads.tex | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 359af7dcd0..ff2990ef10 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -1981,7 +1981,7 @@ static unsigned int hardware_concurrency() noexcept; private: - stop_source ssource; // \expos + stop_source @\exposid{ssource}@; // \expos }; } \end{codeblock} @@ -2002,7 +2002,7 @@ \pnum \ensures \tcode{get_id() == id()} is \tcode{true} -and \tcode{ssource.stop_possible()} is \tcode{false}. +and \tcode{\exposid{ssource}.stop_possible()} is \tcode{false}. \end{itemdescr} \indexlibraryctor{jthread}% @@ -2026,7 +2026,7 @@ \pnum \effects -Initializes \tcode{ssource}. +Initializes \exposid{ssource}. The new thread of execution executes \begin{codeblock} invoke(auto(std::forward(f)), get_stop_token(), // for \tcode{invoke}, see \ref{func.invoke} @@ -2055,7 +2055,7 @@ \pnum \ensures \tcode{get_id() != id()} is \tcode{true} -and \tcode{ssource.stop_possible()} is \tcode{true} +and \tcode{\exposid{ssource}.stop_possible()} is \tcode{true} and \tcode{*this} represents the newly started thread. \begin{note} The calling thread can make a stop request only once, @@ -2087,9 +2087,9 @@ \tcode{x.get_id() == id()} and \tcode{get_id()} returns the value of \tcode{x.get_id()} prior to the start of construction. -\tcode{ssource} has the value of \tcode{x.ssource} +\exposid{ssource} has the value of \tcode{x.\exposid{ssource}} prior to the start of construction -and \tcode{x.ssource.stop_possible()} is \tcode{false}. +and \tcode{x.\exposid{ssource}.stop_possible()} is \tcode{false}. \end{itemdescr} \indexlibrarydtor{jthread}% @@ -2125,7 +2125,7 @@ \ensures \tcode{get_id()} returns the value of \tcode{x.get_id()} prior to the assignment. -\tcode{ssource} has the value of \tcode{x.ssource} +\exposid{ssource} has the value of \tcode{x.\exposid{ssource}} prior to the assignment. \pnum @@ -2253,7 +2253,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return ssource;} +Equivalent to: \tcode{return \exposid{ssource};} \end{itemdescr} \indexlibrarymember{get_stop_token}{jthread}% @@ -2264,7 +2264,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return ssource.get_token();} +Equivalent to: \tcode{return \exposid{ssource}.get_token();} \end{itemdescr} \indexlibrarymember{request_stop}{jthread}% @@ -2275,7 +2275,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return ssource.request_stop();} +Equivalent to: \tcode{return \exposid{ssource}.request_stop();} \end{itemdescr} From bdd446e67fd5bd7492734fc34e0500717b1618e7 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:16:23 +0800 Subject: [PATCH 02/13] [atomics.ref.generic] Exposition-only style for `ptr` --- source/threads.tex | 104 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index ff2990ef10..302763d352 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3150,7 +3150,7 @@ namespace std { template struct atomic_ref { private: - T* ptr; // \expos + T* @\exposid{ptr}@; // \expos public: using value_type = remove_cv_t; @@ -3191,18 +3191,18 @@ \pnum An \tcode{atomic_ref} object applies atomic operations\iref{atomics.general} to -the object referenced by \tcode{*ptr} such that, +the object referenced by \tcode{*\exposid{ptr}} such that, for the lifetime\iref{basic.life} of the \tcode{atomic_ref} object, -the object referenced by \tcode{*ptr} is an atomic object\iref{intro.races}. +the object referenced by \tcode{*\exposid{ptr}} is an atomic object\iref{intro.races}. \pnum The program is ill-formed if \tcode{is_trivially_copyable_v} is \tcode{false}. \pnum -The lifetime\iref{basic.life} of an object referenced by \tcode{*ptr} +The lifetime\iref{basic.life} of an object referenced by \tcode{*\exposid{ptr}} shall exceed the lifetime of all \tcode{atomic_ref}s that reference the object. While any \tcode{atomic_ref} instances exist -that reference the \tcode{*ptr} object, +that reference the \tcode{*\exposid{ptr}} object, all accesses to that object shall exclusively occur through those \tcode{atomic_ref} instances. No subobject of the object referenced by \tcode{atomic_ref} @@ -3356,7 +3356,7 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with the value of \tcode{desired}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -3405,7 +3405,7 @@ \pnum \returns -Atomically returns the value referenced by \tcode{*ptr}. +Atomically returns the value referenced by \tcode{*\exposid{ptr}}. \end{itemdescr} \indexlibrarymember{operator \placeholder{type}}{atomic_ref}% @@ -3438,14 +3438,14 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with \tcode{desired}. Memory is affected according to the value of \tcode{order}. This operation is an atomic read-modify-write operation\iref{intro.multithread}. \pnum \returns -Atomically returns the value referenced by \tcode{*ptr} +Atomically returns the value referenced by \tcode{*\exposid{ptr}} immediately before the effects. \end{itemdescr} @@ -3487,9 +3487,9 @@ \effects Retrieves the value in \tcode{expected}. It then atomically compares the value representation of -the value referenced by \tcode{*ptr} for equality +the value referenced by \tcode{*\exposid{ptr}} for equality with that previously retrieved from \tcode{expected}, -and if \tcode{true}, replaces the value referenced by \tcode{*ptr} +and if \tcode{true}, replaces the value referenced by \tcode{*\exposid{ptr}} with that in \tcode{desired}. If and only if the comparison is \tcode{true}, memory is affected according to the value of \tcode{success}, and @@ -3505,11 +3505,11 @@ If and only if the comparison is \tcode{false} then, after the atomic operation, the value in \tcode{expected} is replaced by -the value read from the value referenced by \tcode{*ptr} +the value read from the value referenced by \tcode{*\exposid{ptr}} during the atomic comparison. If the operation returns \tcode{true}, these operations are atomic read-modify-write operations\iref{intro.races} -on the value referenced by \tcode{*ptr}. +on the value referenced by \tcode{*\exposid{ptr}}. Otherwise, these operations are atomic load operations on that memory. \pnum @@ -3520,7 +3520,7 @@ \remarks A weak compare-and-exchange operation may fail spuriously. That is, even when the contents of memory referred to -by \tcode{expected} and \tcode{ptr} are equal, +by \tcode{expected} and \exposid{ptr} are equal, it may return \tcode{false} and store back to \tcode{expected} the same memory contents that were originally there. @@ -3566,7 +3566,7 @@ \pnum \remarks This function is an atomic waiting operation\iref{atomics.wait} -on atomic object \tcode{*ptr}. +on atomic object \tcode{*\exposid{ptr}}. \end{itemdescr} \indexlibrarymember{notify_one}{atomic_ref}% @@ -3581,14 +3581,14 @@ \pnum \effects -Unblocks the execution of at least one atomic waiting operation on \tcode{*ptr} +Unblocks the execution of at least one atomic waiting operation on \tcode{*\exposid{ptr}} that is eligible to be unblocked\iref{atomics.wait} by this call, if any such atomic waiting operations exist. \pnum \remarks This function is an atomic notifying operation\iref{atomics.wait} -on atomic object \tcode{*ptr}. +on atomic object \tcode{*\exposid{ptr}}. \end{itemdescr} \indexlibrarymember{notify_all}{atomic_ref}% @@ -3603,13 +3603,13 @@ \pnum \effects -Unblocks the execution of all atomic waiting operations on \tcode{*ptr} +Unblocks the execution of all atomic waiting operations on \tcode{*\exposid{ptr}} that are eligible to be unblocked\iref{atomics.wait} by this call. \pnum \remarks This function is an atomic notifying operation\iref{atomics.wait} -on atomic object \tcode{*ptr}. +on atomic object \tcode{*\exposid{ptr}}. \end{itemdescr} \indexlibrarymember{address}{atomic_ref}% @@ -3620,7 +3620,7 @@ \begin{itemdescr} \pnum \returns -\tcode{ptr}. +\exposid{ptr}. \end{itemdescr} \rSec3[atomics.ref.int]{Specializations for integral types} @@ -3646,7 +3646,7 @@ namespace std { template<> struct atomic_ref<@\placeholder{integral-type}@> { private: - @\placeholder{integral-type}@* ptr; // \expos + @\placeholder{integral-type}@* @\exposid{ptr}@; // \expos public: using value_type = remove_cv_t<@\placeholder{integral-type}@>; @@ -3754,15 +3754,15 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} with -the result of the computation applied to the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} and the given operand. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.races}. \pnum \returns -Atomically, the value referenced by \tcode{*ptr} +Atomically, the value referenced by \tcode{*\exposid{ptr}} immediately before the effects. \pnum @@ -3808,9 +3808,9 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with the result of the computation applied to -the value referenced by \tcode{*ptr} and the given \tcode{operand}. +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic modify-write operations\iref{atomics.order}. @@ -3818,7 +3818,7 @@ \remarks Except for \tcode{store_max} and \tcode{store_min}, for signed integer types, -the result is as if \tcode{*ptr} and parameters +the result is as if \tcode{*\exposid{ptr}} and parameters were converted to their corresponding unsigned types, the computation performed on those types, and the result converted back to the signed type. @@ -3828,7 +3828,7 @@ For \tcode{store_max} and \tcode{store_min}, the maximum and minimum computation is performed as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \end{itemdescr} \indexlibrarymember{operator+=}{atomic_ref<\placeholder{integral-type}>}% @@ -3870,7 +3870,7 @@ namespace std { template<> struct atomic_ref<@\placeholder{floating-point-type}@> { private: - @\placeholder{floating-point-type}@* ptr; // \expos + @\placeholder{floating-point-type}@* @\exposid{ptr}@; // \expos public: using value_type = remove_cv_t<@\placeholder{floating-point-type}@>; @@ -3983,15 +3983,15 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} with -the result of the computation applied to the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} and the given operand. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.races}. \pnum \returns -Atomically, the value referenced by \tcode{*ptr} +Atomically, the value referenced by \tcode{*\exposid{ptr}} immediately before the effects. \pnum @@ -4012,27 +4012,27 @@ For \tcode{fetch_fmaximum} and \tcode{fetch_fminimum}, the maximum and minimum computation is performed as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \item For \tcode{fetch_fmaximum_num} and \tcode{fetch_fminimum_num}, the maximum and minimum computation is performed as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \item For \tcode{fetch_max} and \tcode{fetch_min}, the maximum and minimum computation is performed as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, -with \tcode{*ptr} and the first parameter as the arguments, except that: +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: \begin{itemize} \item -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. \item If exactly one argument is a NaN, -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}; +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}; it is unspecified which. \item If the arguments are differently signed zeros, -which of these values is stored at \tcode{*ptr} is unspecified. +which of these values is stored at \tcode{*\exposid{ptr}} is unspecified. \end{itemize} \end{itemize} @@ -4068,9 +4068,9 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with the result of the computation applied to -the value referenced by \tcode{*ptr} and the given \tcode{operand}. +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic modify-write operations\iref{atomics.order}. @@ -4098,23 +4098,23 @@ For \tcode{store_fmaximum} and \tcode{store_fminimum}, the maximum and minimum computation is performed as if by \tcode{fmaximum} and \tcode{fminimum}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \item For \tcode{store_fmaximum_num} and \tcode{store_fminimum_num}, the maximum and minimum computation is performed as if by \tcode{fmaximum_num }and \tcode{fminimum_num}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \item For \tcode{store_max} and \tcode{store_min}, the maximum and minimum computation is performed as if by \tcode{fmaximum_num} and \tcode{fminimum_num}, respectively, -with \tcode{*ptr} and the first parameter as the arguments, except that: +with \tcode{*\exposid{ptr}} and the first parameter as the arguments, except that: \begin{itemize} \item -If both arguments are NaN, an unspecified NaN value is stored at \tcode{*ptr}. +If both arguments are NaN, an unspecified NaN value is stored at \tcode{*\exposid{ptr}}. \item If exactly one argument is a NaN, -either the other argument or an unspecified NaN value is stored at \tcode{*ptr}, +either the other argument or an unspecified NaN value is stored at \tcode{*\exposid{ptr}}, it is unspecified which. \item If the arguments are differently signed zeros, @@ -4164,7 +4164,7 @@ namespace std { template<> struct atomic_ref<@\placeholder{pointer-type}@> { private: - @\placeholder{pointer-type}@* ptr; // \expos + @\placeholder{pointer-type}@* @\exposid{ptr}@; // \expos public: using value_type = remove_cv_t<@\placeholder{pointer-type}@>; @@ -4258,15 +4258,15 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} with -the result of the computation applied to the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with +the result of the computation applied to the value referenced by \tcode{*\exposid{ptr}} and the given operand. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.races}. \pnum \returns -Atomically, the value referenced by \tcode{*ptr} +Atomically, the value referenced by \tcode{*\exposid{ptr}} immediately before the effects. \pnum @@ -4313,9 +4313,9 @@ \pnum \effects -Atomically replaces the value referenced by \tcode{*ptr} +Atomically replaces the value referenced by \tcode{*\exposid{ptr}} with the result of the computation applied to -the value referenced by \tcode{*ptr} and the given \tcode{operand}. +the value referenced by \tcode{*\exposid{ptr}} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic modify-write operations\iref{atomics.order}. @@ -4326,7 +4326,7 @@ For \tcode{store_max} and \tcode{store_min}, the \tcode{maximum} and \tcode{minimum} computation is performed as if by \tcode{max} and \tcode{min} algorithms\iref{alg.min.max}, respectively, -with \tcode{*ptr} and the first parameter as the arguments. +with \tcode{*\exposid{ptr}} and the first parameter as the arguments. \begin{note} If the pointers point to different complete objects (or subobjects thereof), the \tcode{<} operator does not establish From 9e8888c0ddc78a5c893b85710e740de6aaffa480 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:17:33 +0800 Subject: [PATCH 03/13] [atomics.ref.float] Use `\placeholder` for `floating-point-type` --- source/threads.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 302763d352..1a8206ef2c 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3979,7 +3979,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{is_const_v<\exposid{floating-point-type}>} is \tcode{false}. +\tcode{is_const_v<\placeholder{floating-point-type}>} is \tcode{false}. \pnum \effects @@ -4137,7 +4137,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{is_const_v<\exposid{floating-point-type}>} is \tcode{false}. +\tcode{is_const_v<\placeholder{floating-point-type}>} is \tcode{false}. \pnum \effects From c3f57babd3fb5b7ef06092506354b351157c4c46 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:18:17 +0800 Subject: [PATCH 04/13] [util.smartptr.atomic.shared] Exposition-only style for `p` --- source/threads.tex | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 1a8206ef2c..b58290052d 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6138,7 +6138,7 @@ constexpr void notify_all() noexcept; private: - shared_ptr p; // \expos + shared_ptr @\exposid{p}@; // \expos }; } \end{codeblock} @@ -6151,7 +6151,7 @@ \begin{itemdescr} \pnum \effects -Value-initializes \tcode{p}. +Value-initializes \exposid{p}. \end{itemdescr} \indexlibraryctor{atomic>}% @@ -6192,7 +6192,7 @@ \pnum \effects Atomically replaces the value pointed to by \keyword{this} with -the value of \tcode{desired} as if by \tcode{p.swap(desired)}. +the value of \tcode{desired} as if by \tcode{\exposid{p}.swap(desired)}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -6237,7 +6237,7 @@ \pnum \returns -Atomically returns \tcode{p}. +Atomically returns \exposid{p}. \end{itemdescr} \indexlibrarymember{operator shared_ptr}{atomic>}% @@ -6260,14 +6260,14 @@ \begin{itemdescr} \pnum \effects -Atomically replaces \tcode{p} with \tcode{desired} -as if by \tcode{p.swap(desired)}. +Atomically replaces \exposid{p} with \tcode{desired} +as if by \tcode{\exposid{p}.swap(desired)}. Memory is affected according to the value of \tcode{order}. This is an atomic read-modify-write operation\iref{intro.races}. \pnum \returns -Atomically returns the value of \tcode{p} immediately before the effects. +Atomically returns the value of \exposid{p} immediately before the effects. \end{itemdescr} \indexlibrarymember{compare_exchange_weak}{atomic>}% @@ -6289,15 +6289,15 @@ \pnum \effects -If \tcode{p} is equivalent to \tcode{expected}, -assigns \tcode{desired} to \tcode{p} and +If \exposid{p} is equivalent to \tcode{expected}, +assigns \tcode{desired} to \exposid{p} and has synchronization semantics corresponding to the value of \tcode{success}, -otherwise assigns \tcode{p} to \tcode{expected} and +otherwise assigns \exposid{p} to \tcode{expected} and has synchronization semantics corresponding to the value of \tcode{failure}. \pnum \returns -\tcode{true} if \tcode{p} was equivalent to \tcode{expected}, +\tcode{true} if \exposid{p} was equivalent to \tcode{expected}, \tcode{false} otherwise. \pnum From 305505ff3b513b8267dc63889f73e6a342fcbd79 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:18:46 +0800 Subject: [PATCH 05/13] [util.smartptr.atomic.weak] Exposition-only style for `p` --- source/threads.tex | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index b58290052d..3daf417e0d 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6466,7 +6466,7 @@ constexpr void notify_all() noexcept; private: - weak_ptr p; // \expos + weak_ptr @\exposid{p}@; // \expos }; } \end{codeblock} @@ -6479,7 +6479,7 @@ \begin{itemdescr} \pnum \effects -Value-initializes \tcode{p}. +Value-initializes \exposid{p}. \end{itemdescr} \indexlibraryctor{atomic>}% @@ -6520,7 +6520,7 @@ \pnum \effects Atomically replaces the value pointed to by \keyword{this} with -the value of \tcode{desired} as if by \tcode{p.swap(desired)}. +the value of \tcode{desired} as if by \tcode{\exposid{p}.swap(desired)}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -6554,7 +6554,7 @@ \pnum \returns -Atomically returns \tcode{p}. +Atomically returns \exposid{p}. \end{itemdescr} \indexlibrarymember{operator weak_ptr}{atomic>}% @@ -6577,14 +6577,14 @@ \begin{itemdescr} \pnum \effects -Atomically replaces \tcode{p} with \tcode{desired} -as if by \tcode{p.swap(desired)}. +Atomically replaces \exposid{p} with \tcode{desired} +as if by \tcode{\exposid{p}.swap(desired)}. Memory is affected according to the value of \tcode{order}. This is an atomic read-modify-write operation\iref{intro.races}. \pnum \returns -Atomically returns the value of \tcode{p} immediately before the effects. +Atomically returns the value of \exposid{p} immediately before the effects. \end{itemdescr} \indexlibrarymember{compare_exchange_weak}{atomic>}% @@ -6605,15 +6605,15 @@ \pnum \effects -If \tcode{p} is equivalent to \tcode{expected}, -assigns \tcode{desired} to \tcode{p} and +If \exposid{p} is equivalent to \tcode{expected}, +assigns \tcode{desired} to \exposid{p} and has synchronization semantics corresponding to the value of \tcode{success}, -otherwise assigns \tcode{p} to \tcode{expected} and +otherwise assigns \exposid{p} to \tcode{expected} and has synchronization semantics corresponding to the value of \tcode{failure}. \pnum \returns -\tcode{true} if \tcode{p} was equivalent to \tcode{expected}, +\tcode{true} if \exposid{p} was equivalent to \tcode{expected}, \tcode{false} otherwise. \pnum From 9579dbac963ada74808aa2087ceec37873f9b08e Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:31:24 +0800 Subject: [PATCH 06/13] [thread.lock.guard] Exposition-only style for `pm` --- source/threads.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 3daf417e0d..15f001ec5f 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8176,7 +8176,7 @@ lock_guard& operator=(const lock_guard&) = delete; private: - mutex_type& pm; // \expos + mutex_type& @\exposid{pm}@; // \expos }; } \end{codeblock} @@ -8186,7 +8186,7 @@ within a scope. A \tcode{lock_guard} object maintains ownership of a lockable object throughout the \tcode{lock_guard} object's lifetime\iref{basic.life}. The behavior of a program is undefined if the lockable object referenced by -\tcode{pm} does not exist for the entire lifetime of the \tcode{lock_guard} +\exposid{pm} does not exist for the entire lifetime of the \tcode{lock_guard} object. The supplied \tcode{Mutex} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. @@ -8198,7 +8198,7 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{pm} with \tcode{m}. Calls \tcode{m.lock()}. +Initializes \exposid{pm} with \tcode{m}. Calls \tcode{m.lock()}. \end{itemdescr} \indexlibraryctor{lock_guard}% @@ -8213,7 +8213,7 @@ \pnum \effects -Initializes \tcode{pm} with \tcode{m}. +Initializes \exposid{pm} with \tcode{m}. \pnum \throws @@ -8228,7 +8228,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{pm.unlock()} +Equivalent to: \tcode{\exposid{pm}.unlock()} \end{itemdescr} \rSec3[thread.lock.scoped]{Class template \tcode{scoped_lock}} From 77c56aa791db3032b226d808ae433d310961c5a7 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:31:59 +0800 Subject: [PATCH 07/13] [thread.lock.scoped] Exposition-only style for `pm` --- source/threads.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 15f001ec5f..9cc26f5232 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8249,7 +8249,7 @@ scoped_lock& operator=(const scoped_lock&) = delete; private: - tuple pm; // \expos + tuple @\exposid{pm}@; // \expos }; } \end{codeblock} @@ -8259,7 +8259,7 @@ within a scope. A \tcode{scoped_lock} object maintains ownership of lockable objects throughout the \tcode{scoped_lock} object's lifetime\iref{basic.life}. The behavior of a program is undefined if the lockable objects referenced by -\tcode{pm} do not exist for the entire lifetime of the \tcode{scoped_lock} +\exposid{pm} do not exist for the entire lifetime of the \tcode{scoped_lock} object. \begin{itemize} \item @@ -8283,7 +8283,7 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{pm} with \tcode{tie(m...)}. +Initializes \exposid{pm} with \tcode{tie(m...)}. Then if \tcode{sizeof...(MutexTypes)} is \tcode{0}, no effects. Otherwise if \tcode{sizeof...(MutexTypes)} is \tcode{1}, then \tcode{m.lock()}. Otherwise, \tcode{lock(m...)}. @@ -8301,7 +8301,7 @@ \pnum \effects -Initializes \tcode{pm} with \tcode{tie(m...)}. +Initializes \exposid{pm} with \tcode{tie(m...)}. \pnum \throws @@ -8317,7 +8317,7 @@ \pnum \effects For all \tcode{i} in \range{0}{sizeof...(MutexTypes)}, -\tcode{get(pm).unlock()}. +\tcode{get(\exposid{pm}).unlock()}. \end{itemdescr} \rSec3[thread.lock.unique]{Class template \tcode{unique_lock}} From cfac6c1305ce553b02700b98831042bab9e4f42a Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:50:20 +0800 Subject: [PATCH 08/13] [thread.lock.unique] Exposition-only style for `pm` and `owns` --- source/threads.tex | 90 +++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 9cc26f5232..474e965d64 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8371,8 +8371,8 @@ mutex_type* mutex() const noexcept; private: - mutex_type* pm; // \expos - bool owns; // \expos + mutex_type* @\exposid{pm}@; // \expos + bool @\exposid{owns}@; // \expos }; } \end{codeblock} @@ -8383,8 +8383,8 @@ construction or after construction, and may be transferred, after acquisition, to another \tcode{unique_lock} object. Objects of type \tcode{unique_lock} are not copyable but are movable. The behavior of a program is undefined if the contained pointer -\tcode{pm} is not null and the lockable object pointed -to by \tcode{pm} does not exist for the entire remaining +\exposid{pm} is not null and the lockable object pointed +to by \exposid{pm} does not exist for the entire remaining lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied \tcode{Mutex} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. @@ -8409,7 +8409,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == nullptr} and \tcode{owns == false}. +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. \end{itemdescr} \indexlibraryctor{unique_lock}% @@ -8424,7 +8424,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == true}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. \end{itemdescr} \indexlibraryctor{unique_lock}% @@ -8435,7 +8435,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == false}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == false}. \end{itemdescr} \indexlibraryctor{unique_lock}% @@ -8455,7 +8455,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res}, +\tcode{\exposid{pm} == addressof(m)} and \tcode{o\exposid{owns}wns == res}, where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}. \end{itemdescr} @@ -8471,7 +8471,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == true}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. \pnum \throws @@ -8496,7 +8496,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res}, +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{m.try_lock_until(abs_time)}. \end{itemdescr} @@ -8518,7 +8518,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res}, +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}. \end{itemdescr} @@ -8530,7 +8530,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == u_p.pm} and \tcode{owns == u_p.owns} (where \tcode{u_p} is the state of \tcode{u} just prior to this construction), \tcode{u.pm == 0} and \tcode{u.owns == false}. +\tcode{\exposid{pm} == u_p.\exposid{pm}} and \tcode{\exposid{owns} == u_p.\exposid{owns}} (where \tcode{u_p} is the state of \tcode{u} just prior to this construction), \tcode{u.\exposid{pm} == 0} and \tcode{u.\exposid{owns} == false}. \end{itemdescr} \indexlibrarymember{operator=}{unique_lock}% @@ -8556,7 +8556,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{owns} calls \tcode{pm->unlock()}. +If \exposid{owns} calls \tcode{\exposid{pm}->unlock()}. \end{itemdescr} \rSec4[thread.lock.unique.locking]{Locking} @@ -8569,22 +8569,22 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{pm->lock()}. +As if by \tcode{\exposid{pm}->lock()}. \pnum \ensures -\tcode{owns == true}. +\tcode{\exposid{owns} == true}. \pnum \throws -Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} when an exception +Any exception thrown by \tcode{\exposid{pm}->lock()}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -8602,27 +8602,27 @@ \pnum \effects -As if by \tcode{pm->try_lock()}. +As if by \tcode{\exposid{pm}->try_lock()}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by -\tcode{pm->try_lock()}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by +\tcode{\exposid{pm}->try_lock()}. \pnum \returns -The value returned by \tcode{pm->try_lock()}. +The value returned by \tcode{\exposid{pm}->try_lock()}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} when an exception +Any exception thrown by \tcode{\exposid{pm}->try_lock()}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -8641,27 +8641,27 @@ \pnum \effects -As if by \tcode{pm->try_lock_until(abs_time)}. +As if by \tcode{\exposid{pm}->try_lock_until(abs_time)}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by -\tcode{pm->try_lock_until(abs_time)}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by +\tcode{\exposid{pm}->try_lock_until(abs_time)}. \pnum \returns -The value returned by \tcode{pm->try_lock_until(abs_time)}. +The value returned by \tcode{\exposid{pm}->try_lock_until(abs_time)}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock_until(abstime)}. \tcode{system_error} when an +Any exception thrown by \tcode{\exposid{pm}->try_lock_until(abstime)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -8679,26 +8679,26 @@ \pnum \effects -As if by \tcode{pm->try_lock_for(rel_time)}. +As if by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by \tcode{pm->try_lock_for(rel_time)}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \pnum \returns -The value returned by \tcode{pm->try_lock_for(rel_time)}. +The value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock_for(rel_time)}. \tcode{system_error} when an +Any exception thrown by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -8711,11 +8711,11 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{pm->unlock()}. +As if by \tcode{\exposid{pm}->unlock()}. \pnum \ensures -\tcode{owns == false}. +\tcode{\exposid{owns} == false}. \pnum \throws @@ -8725,7 +8725,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is \tcode{false}. +\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is \tcode{false}. \end{itemize} \end{itemdescr} @@ -8750,11 +8750,11 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == 0} and \tcode{owns == false}. +\tcode{\exposid{pm} == 0} and \tcode{\exposid{owns} == false}. \pnum \returns -The previous value of \tcode{pm}. +The previous value of \exposid{pm}. \end{itemdescr} \indexlibrarymember{swap}{unique_lock}% @@ -8779,7 +8779,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{operator bool}{unique_lock}% @@ -8801,7 +8801,7 @@ \begin{itemdescr} \pnum \returns -\tcode{pm}. +\exposid{pm}. \end{itemdescr} \rSec3[thread.lock.shared]{Class template \tcode{shared_lock}} From 39cdfceb5d3f44bf5ae1944ee6e51d1079d233c7 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:50:49 +0800 Subject: [PATCH 09/13] [thread.lock.shared] Exposition-only style for `pm` and `owns` --- source/threads.tex | 94 +++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 474e965d64..536d78bb31 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8853,8 +8853,8 @@ mutex_type* mutex() const noexcept; private: - mutex_type* pm; // \expos - bool owns; // \expos + mutex_type* @\exposid{pm}@; // \expos + bool @\exposid{owns}@; // \expos }; } \end{codeblock} @@ -8865,8 +8865,8 @@ acquired at construction or after construction, and may be transferred, after acquisition, to another \tcode{shared_lock} object. Objects of type \tcode{shared_lock} are not copyable but are movable. The behavior of a program -is undefined if the contained pointer \tcode{pm} is not null and the lockable -object pointed to by \tcode{pm} does not exist for the entire remaining +is undefined if the contained pointer \exposid{pm} is not null and the lockable +object pointed to by \exposid{pm} does not exist for the entire remaining lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied \tcode{Mutex} type shall meet the \oldconcept{SharedLockable} requirements\iref{thread.req.lockable.shared}. @@ -8891,7 +8891,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == nullptr} and \tcode{owns == false}. +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. \end{itemdescr} \indexlibraryctor{shared_lock}% @@ -8906,7 +8906,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == true}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. \end{itemdescr} \indexlibraryctor{shared_lock}% @@ -8917,7 +8917,7 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == false}. +\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}. \end{itemdescr} \indexlibraryctor{shared_lock}% @@ -8932,7 +8932,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res} +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} where \tcode{res} is the value returned by the call to \tcode{m.try_lock_shared()}. \end{itemdescr} @@ -8949,7 +8949,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == true}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. \end{itemdescr} \indexlibraryctor{shared_lock}% @@ -8971,7 +8971,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res} +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} where \tcode{res} is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}. \end{itemdescr} @@ -8995,7 +8995,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == res} +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} where \tcode{res} is the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}. \end{itemdescr} @@ -9008,7 +9008,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{owns} calls \tcode{pm->unlock_shared()}. +If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}. \end{itemdescr} \indexlibraryctor{shared_lock}% @@ -9019,9 +9019,9 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where +\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where \tcode{sl_p} is the state of \tcode{sl} just prior to this construction), -\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}. +\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}. \end{itemdescr} \indexlibrarymember{operator=}{shared_lock}% @@ -9049,22 +9049,22 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{pm->lock_shared()}. +As if by \tcode{\exposid{pm}->lock_shared()}. \pnum \ensures -\tcode{owns == true}. +\tcode{\exposid{owns} == true}. \pnum \throws -Any exception thrown by \tcode{pm->lock_shared()}. +Any exception thrown by \tcode{\exposid{pm}->lock_shared()}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -9077,27 +9077,27 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{pm->try_lock_shared()}. +As if by \tcode{\exposid{pm}->try_lock_shared()}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by -the call to \tcode{pm->try_lock_shared()}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by +the call to \tcode{\exposid{pm}->try_lock_shared()}. \pnum \returns -The value returned by the call to \tcode{pm->try_lock_shared()}. +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock_shared()}. +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared()}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -9116,28 +9116,28 @@ \pnum \effects -As if by \tcode{pm->try_lock_shared_until(abs_time)}. +As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by -the call to \tcode{pm->try_lock_shared_until(abs_time)}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by +the call to \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. \pnum \returns The value returned by the call to -\tcode{pm->try_lock_shared_until(abs_time)}. +\tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}. +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -9156,25 +9156,25 @@ \pnum \effects -As if by \tcode{pm->try_lock_shared_for(rel_time)}. +As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. \pnum \ensures -\tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. \pnum \returns -The value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. \pnum \throws -Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is \tcode{true}. \end{itemize} \end{itemdescr} @@ -9187,11 +9187,11 @@ \begin{itemdescr} \pnum \effects -As if by \tcode{pm->unlock_shared()}. +As if by \tcode{\exposid{pm}->unlock_shared()}. \pnum \ensures -\tcode{owns == false}. +\tcode{\exposid{owns} == false}. \pnum \throws @@ -9200,7 +9200,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is +\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is \tcode{false}. \end{itemize} \end{itemdescr} @@ -9226,11 +9226,11 @@ \begin{itemdescr} \pnum \ensures -\tcode{pm == nullptr} and \tcode{owns == false}. +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. \pnum \returns -The previous value of \tcode{pm}. +The previous value of \exposid{pm}. \end{itemdescr} \indexlibrarymember{swap}{shared_lock}% @@ -9255,7 +9255,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{operator bool}{shared_lock}% @@ -9266,7 +9266,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{mutex}{shared_lock}% @@ -9277,7 +9277,7 @@ \begin{itemdescr} \pnum \returns -\tcode{pm}. +\exposid{pm}. \end{itemdescr} \rSec2[thread.lock.algorithm]{Generic locking algorithms} From 144d4e02abed1534e18c2123ffa6f05cf627e2c4 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:52:32 +0800 Subject: [PATCH 10/13] [thread.sema.cnt] Exposition-only style for `counter` --- source/threads.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 536d78bb31..c7367866e4 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10467,7 +10467,7 @@ bool try_acquire_until(const chrono::time_point& abs_time); private: - ptrdiff_t counter; // \expos + ptrdiff_t @\exposid{counter}@; // \expos }; } \end{codeblock} @@ -10497,7 +10497,7 @@ \begin{itemdescr} \pnum \returns -The maximum value of \tcode{counter}. +The maximum value of \exposid{counter}. This value is greater than or equal to \tcode{least_max_value}. \end{itemdescr} @@ -10514,7 +10514,7 @@ \pnum \effects -Initializes \tcode{counter} with \tcode{desired}. +Initializes \exposid{counter} with \tcode{desired}. \pnum \throws @@ -10530,13 +10530,13 @@ \pnum \expects \tcode{update >= 0} is \tcode{true}, and -\tcode{update <= max() - counter} is \tcode{true}. +\tcode{update <= max() - \exposid{counter}} is \tcode{true}. \pnum \effects -Atomically execute \tcode{counter += update}. +Atomically execute \tcode{\exposid{counter} += update}. Then, unblocks any threads -that are waiting for \tcode{counter} to be greater than zero. +that are waiting for \exposid{counter} to be greater than zero. \pnum \sync @@ -10561,11 +10561,11 @@ \begin{itemdescr} \pnum \effects -Attempts to atomically decrement \tcode{counter} if it is positive, +Attempts to atomically decrement \exposid{counter} if it is positive, without blocking. -If \tcode{counter} is not decremented, there is no effect and +If \exposid{counter} is not decremented, there is no effect and \tcode{try_acquire} immediately returns. -An implementation may fail to decrement \tcode{counter} +An implementation may fail to decrement \exposid{counter} even if it is positive. \begin{note} This spurious failure is normally uncommon, but @@ -10578,7 +10578,7 @@ \pnum \returns -\tcode{true} if \tcode{counter} was decremented, otherwise \tcode{false}. +\tcode{true} if \exposid{counter} was decremented, otherwise \tcode{false}. \end{itemdescr} \indexlibrarymember{acquire}{counting_semaphore}% @@ -10594,7 +10594,7 @@ \item Evaluates \tcode{try_acquire()}. If the result is \tcode{true}, returns. \item \indextext{block (execution)}% -Blocks on \tcode{*this} until \tcode{counter} is greater than zero. +Blocks on \tcode{*this} until \exposid{counter} is greater than zero. \end{itemize} \pnum @@ -10627,7 +10627,7 @@ \item \indextext{block (execution)}% Blocks on \tcode{*this} - until \tcode{counter} is greater than zero or until the timeout expires. + until \exposid{counter} is greater than zero or until the timeout expires. If it is unblocked by the timeout expiring, returns \tcode{false}. \end{itemize} The timeout expires\iref{thread.req.timing} From dd76b55711984156fc754adc3c986988b7697045 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:53:04 +0800 Subject: [PATCH 11/13] [thread.latch.class] Exposition-only style for `counter` --- source/threads.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index c7367866e4..8a3d4830d7 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10697,7 +10697,7 @@ void arrive_and_wait(ptrdiff_t update = 1); private: - ptrdiff_t counter; // \expos + ptrdiff_t @\exposid{counter}@; // \expos }; } \end{codeblock} @@ -10720,7 +10720,7 @@ \begin{itemdescr} \pnum \returns -The maximum value of \tcode{counter} that the implementation supports. +The maximum value of \exposid{counter} that the implementation supports. \end{itemdescr} \indexlibraryctor{latch}% @@ -10736,7 +10736,7 @@ \pnum \effects -Initializes \tcode{counter} with \tcode{expected}. +Initializes \exposid{counter} with \tcode{expected}. \pnum \throws @@ -10752,12 +10752,12 @@ \pnum \expects \tcode{update >= 0} is \tcode{true}, and -\tcode{update <= counter} is \tcode{true}. +\tcode{update <= \exposid{counter}} is \tcode{true}. \pnum \effects -Atomically decrements \tcode{counter} by \tcode{update}. -If \tcode{counter} is equal to zero, +Atomically decrements \exposid{counter} by \tcode{update}. +If \exposid{counter} is equal to zero, unblocks all threads blocked on \tcode{*this}. \pnum @@ -10782,7 +10782,7 @@ \begin{itemdescr} \pnum \returns -With very low probability \tcode{false}. Otherwise \tcode{counter == 0}. +With very low probability \tcode{false}. Otherwise \tcode{\exposid{counter} == 0}. \end{itemdescr} \indexlibrarymember{wait}{latch}% @@ -10794,9 +10794,9 @@ \pnum \indextext{block (execution)}% \effects -If \tcode{counter} equals zero, returns immediately. +If \exposid{counter} equals zero, returns immediately. Otherwise, blocks on \tcode{*this} -until a call to \tcode{count_down} that decrements \tcode{counter} to zero. +until a call to \tcode{count_down} that decrements \exposid{counter} to zero. \pnum \throws From 0645536675804b02fb742d313af51c8460d464b4 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:53:27 +0800 Subject: [PATCH 12/13] [thread.barrier.class] Exposition-only style for `completion` --- source/threads.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 8a3d4830d7..b200ce8c81 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10872,7 +10872,7 @@ void arrive_and_drop(); private: - CompletionFunction completion; // \expos + CompletionFunction @\exposid{completion}@; // \expos }; } \end{codeblock} @@ -10909,7 +10909,7 @@ The \defn{phase completion step} that is executed at the end of each phase has the following effects: \begin{itemize} -\item Invokes the completion function, equivalent to \tcode{completion()}. +\item Invokes the completion function, equivalent to \tcode{\exposid{completion}()}. \item Unblocks all threads that are blocked on the phase synchronization point. \end{itemize} The end of the completion step strongly happens before @@ -10937,7 +10937,7 @@ in addition to satisfying the requirements of \tcode{CompletionFunction}, it meets the \oldconcept{DefaultConstructible} requirements (\tref{cpp17.defaultconstructible}) and -\tcode{completion()} has no effects. +\tcode{\exposid{completion}()} has no effects. \pnum \tcode{barrier::arrival_token} is an unspecified type, @@ -10973,7 +10973,7 @@ \effects Sets both the initial expected count for each barrier phase and the current expected count for the first phase to \tcode{expected}. -Initializes \tcode{completion} with \tcode{std::move(f)}. +Initializes \exposid{completion} with \tcode{std::move(f)}. Starts the first phase. \begin{note} If \tcode{expected} is 0 this object can only be destroyed. From d04be046f30f5ed7b74b716b69185e16d1af1d40 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Wed, 20 Aug 2025 13:53:53 +0800 Subject: [PATCH 13/13] [futures.future.error] Exposition-only style for `ec_` --- source/threads.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index b200ce8c81..9a23c5bad0 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -11253,7 +11253,7 @@ const char* what() const noexcept; private: - error_code ec_; // \expos + error_code @\exposid{ec_}@; // \expos }; } \end{codeblock} @@ -11266,7 +11266,7 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{ec_} with \tcode{make_error_code(e)}. +Initializes \exposid{ec_} with \tcode{make_error_code(e)}. \end{itemdescr} \indexlibrarymember{code}{future_error}% @@ -11277,7 +11277,7 @@ \begin{itemdescr} \pnum \returns -\tcode{ec_}. +\exposid{ec_}. \end{itemdescr} \indexlibrarymember{what}{future_error}%