From 1bbd739b815533d76848b5fe631ef05c42ebbd01 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 9be4571b79..b480eed40a 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -1968,7 +1968,7 @@ static unsigned int hardware_concurrency() noexcept; private: - stop_source ssource; // \expos + stop_source @\exposid{ssource}@; // \expos }; } \end{codeblock} @@ -1989,7 +1989,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}% @@ -2013,7 +2013,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} @@ -2042,7 +2042,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, @@ -2074,9 +2074,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}% @@ -2112,7 +2112,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 @@ -2240,7 +2240,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return ssource;} +Equivalent to: \tcode{return \exposid{ssource};} \end{itemdescr} \indexlibrarymember{get_stop_token}{jthread}% @@ -2251,7 +2251,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}% @@ -2262,7 +2262,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return ssource.request_stop();} +Equivalent to: \tcode{return \exposid{ssource}.request_stop();} \end{itemdescr} From f51190aac7bdb256f85891dc94ef52b29b7aecad 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 b480eed40a..5c8870e98f 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3202,7 +3202,7 @@ namespace std { template struct atomic_ref { private: - T* ptr; // \expos + T* @\exposid{ptr}@; // \expos public: using value_type = remove_cv_t; @@ -3241,18 +3241,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} @@ -3392,7 +3392,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} @@ -3441,7 +3441,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}% @@ -3474,14 +3474,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} @@ -3523,9 +3523,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 @@ -3541,11 +3541,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 @@ -3556,7 +3556,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. @@ -3602,7 +3602,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}% @@ -3617,14 +3617,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}% @@ -3639,13 +3639,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}% @@ -3656,7 +3656,7 @@ \begin{itemdescr} \pnum \returns -\tcode{ptr}. +\exposid{ptr}. \end{itemdescr} \rSec3[atomics.ref.int]{Specializations for integral types} @@ -3682,7 +3682,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}@>; @@ -3788,15 +3788,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 @@ -3838,9 +3838,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}. @@ -3848,7 +3848,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. @@ -3858,7 +3858,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}>}% @@ -3900,7 +3900,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}@>; @@ -4011,15 +4011,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 @@ -4040,27 +4040,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} @@ -4092,9 +4092,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}. @@ -4122,23 +4122,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, @@ -4188,7 +4188,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}@>; @@ -4280,15 +4280,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 @@ -4331,9 +4331,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}. @@ -4344,7 +4344,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 fe6caa6fe52846b556fa383e2b7e574a6d7eb03a 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 5c8870e98f..2bb7e64d09 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -4007,7 +4007,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 @@ -4161,7 +4161,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 c891d6fcbfe8665c0416930b00daffac8b7f925f 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 2bb7e64d09..0f1a04bcb6 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6166,7 +6166,7 @@ constexpr void notify_all() noexcept; private: - shared_ptr p; // \expos + shared_ptr @\exposid{p}@; // \expos }; } \end{codeblock} @@ -6179,7 +6179,7 @@ \begin{itemdescr} \pnum \effects -Value-initializes \tcode{p}. +Value-initializes \exposid{p}. \end{itemdescr} \indexlibraryctor{atomic>}% @@ -6220,7 +6220,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} @@ -6265,7 +6265,7 @@ \pnum \returns -Atomically returns \tcode{p}. +Atomically returns \exposid{p}. \end{itemdescr} \indexlibrarymember{operator shared_ptr}{atomic>}% @@ -6288,14 +6288,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>}% @@ -6317,15 +6317,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 83b67af02a647a1db42aaaaaf87b71595ead7ae0 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 0f1a04bcb6..7ff575ec58 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6494,7 +6494,7 @@ constexpr void notify_all() noexcept; private: - weak_ptr p; // \expos + weak_ptr @\exposid{p}@; // \expos }; } \end{codeblock} @@ -6507,7 +6507,7 @@ \begin{itemdescr} \pnum \effects -Value-initializes \tcode{p}. +Value-initializes \exposid{p}. \end{itemdescr} \indexlibraryctor{atomic>}% @@ -6548,7 +6548,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} @@ -6582,7 +6582,7 @@ \pnum \returns -Atomically returns \tcode{p}. +Atomically returns \exposid{p}. \end{itemdescr} \indexlibrarymember{operator weak_ptr}{atomic>}% @@ -6605,14 +6605,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>}% @@ -6633,15 +6633,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 59da2061ad548351acaf5b5d30a17155192fd1f1 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 7ff575ec58..4e2db23880 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8204,7 +8204,7 @@ lock_guard& operator=(const lock_guard&) = delete; private: - mutex_type& pm; // \expos + mutex_type& @\exposid{pm}@; // \expos }; } \end{codeblock} @@ -8214,7 +8214,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}. @@ -8226,7 +8226,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}% @@ -8241,7 +8241,7 @@ \pnum \effects -Initializes \tcode{pm} with \tcode{m}. +Initializes \exposid{pm} with \tcode{m}. \pnum \throws @@ -8256,7 +8256,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 b3786e8855cd0f19c21b7baa2d399c76913a76bb 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 4e2db23880..81d3108d23 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8277,7 +8277,7 @@ scoped_lock& operator=(const scoped_lock&) = delete; private: - tuple pm; // \expos + tuple @\exposid{pm}@; // \expos }; } \end{codeblock} @@ -8287,7 +8287,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 @@ -8311,7 +8311,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...)}. @@ -8329,7 +8329,7 @@ \pnum \effects -Initializes \tcode{pm} with \tcode{tie(m...)}. +Initializes \exposid{pm} with \tcode{tie(m...)}. \pnum \throws @@ -8345,7 +8345,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 9870f5daefeb292e9833441804dd45e20d45a328 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 81d3108d23..e9040578ec 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8399,8 +8399,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} @@ -8411,8 +8411,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}. @@ -8437,7 +8437,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}% @@ -8452,7 +8452,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}% @@ -8463,7 +8463,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}% @@ -8483,7 +8483,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} @@ -8499,7 +8499,7 @@ \pnum \ensures -\tcode{pm == addressof(m)} and \tcode{owns == true}. +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. \pnum \throws @@ -8524,7 +8524,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} @@ -8546,7 +8546,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} @@ -8558,7 +8558,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}% @@ -8584,7 +8584,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} @@ -8597,22 +8597,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} @@ -8630,27 +8630,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} @@ -8669,27 +8669,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} @@ -8707,26 +8707,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} @@ -8739,11 +8739,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 @@ -8753,7 +8753,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} @@ -8778,11 +8778,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}% @@ -8807,7 +8807,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{operator bool}{unique_lock}% @@ -8829,7 +8829,7 @@ \begin{itemdescr} \pnum \returns -\tcode{pm}. +\exposid{pm}. \end{itemdescr} \rSec3[thread.lock.shared]{Class template \tcode{shared_lock}} From 87f98d098e35594ed6ddb4896ba15838525f26f7 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 e9040578ec..118d4d0573 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8881,8 +8881,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} @@ -8893,8 +8893,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}. @@ -8919,7 +8919,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}% @@ -8934,7 +8934,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}% @@ -8945,7 +8945,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}% @@ -8960,7 +8960,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} @@ -8977,7 +8977,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}% @@ -8999,7 +8999,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} @@ -9023,7 +9023,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} @@ -9036,7 +9036,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}% @@ -9047,9 +9047,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}% @@ -9077,22 +9077,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} @@ -9105,27 +9105,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} @@ -9144,28 +9144,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} @@ -9184,25 +9184,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} @@ -9215,11 +9215,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 @@ -9228,7 +9228,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} @@ -9254,11 +9254,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}% @@ -9283,7 +9283,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{operator bool}{shared_lock}% @@ -9294,7 +9294,7 @@ \begin{itemdescr} \pnum \returns -\tcode{owns}. +\exposid{owns}. \end{itemdescr} \indexlibrarymember{mutex}{shared_lock}% @@ -9305,7 +9305,7 @@ \begin{itemdescr} \pnum \returns -\tcode{pm}. +\exposid{pm}. \end{itemdescr} \rSec2[thread.lock.algorithm]{Generic locking algorithms} From 3db3328cc97afc3dea88b7f4e37ed800ff8a4911 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 118d4d0573..c0b5e102b6 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10492,7 +10492,7 @@ bool try_acquire_until(const chrono::time_point& abs_time); private: - ptrdiff_t counter; // \expos + ptrdiff_t @\exposid{counter}@; // \expos }; } \end{codeblock} @@ -10522,7 +10522,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} @@ -10539,7 +10539,7 @@ \pnum \effects -Initializes \tcode{counter} with \tcode{desired}. +Initializes \exposid{counter} with \tcode{desired}. \pnum \throws @@ -10555,13 +10555,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 @@ -10586,11 +10586,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 @@ -10603,7 +10603,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}% @@ -10619,7 +10619,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 @@ -10652,7 +10652,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 6aff360eb876ff0a49b6d3b31276c8c9dc281a72 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 c0b5e102b6..a3f4ebed9d 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10722,7 +10722,7 @@ void arrive_and_wait(ptrdiff_t update = 1); private: - ptrdiff_t counter; // \expos + ptrdiff_t @\exposid{counter}@; // \expos }; } \end{codeblock} @@ -10745,7 +10745,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}% @@ -10761,7 +10761,7 @@ \pnum \effects -Initializes \tcode{counter} with \tcode{expected}. +Initializes \exposid{counter} with \tcode{expected}. \pnum \throws @@ -10777,12 +10777,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 @@ -10807,7 +10807,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}% @@ -10819,9 +10819,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 dc6255adb8b1d2dc50c034d90648b705e5296bb5 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 a3f4ebed9d..98990a7452 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10897,7 +10897,7 @@ void arrive_and_drop(); private: - CompletionFunction completion; // \expos + CompletionFunction @\exposid{completion}@; // \expos }; } \end{codeblock} @@ -10934,7 +10934,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 @@ -10962,7 +10962,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, @@ -10998,7 +10998,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 6eb32b6bb4eb255e1649f193f9e5e6e535c7fe39 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 98990a7452..1e41afd5f9 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -11278,7 +11278,7 @@ const char* what() const noexcept; private: - error_code ec_; // \expos + error_code @\exposid{ec_}@; // \expos }; } \end{codeblock} @@ -11291,7 +11291,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}% @@ -11302,7 +11302,7 @@ \begin{itemdescr} \pnum \returns -\tcode{ec_}. +\exposid{ec_}. \end{itemdescr} \indexlibrarymember{what}{future_error}%