Skip to content

Commit 3d73f33

Browse files
[thread.lock.shared] Exposition-only style for pm and owns
1 parent ba9e040 commit 3d73f33

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

source/threads.tex

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8882,8 +8882,8 @@
88828882
mutex_type* mutex() const noexcept;
88838883

88848884
private:
8885-
mutex_type* pm; // \expos
8886-
bool owns; // \expos
8885+
mutex_type* @\exposid{pm}@; // \expos
8886+
bool @\exposid{owns}@; // \expos
88878887
};
88888888
}
88898889
\end{codeblock}
@@ -8894,8 +8894,8 @@
88948894
acquired at construction or after construction, and may be transferred, after
88958895
acquisition, to another \tcode{shared_lock} object. Objects of type
88968896
\tcode{shared_lock} are not copyable but are movable. The behavior of a program
8897-
is undefined if the contained pointer \tcode{pm} is not null and the lockable
8898-
object pointed to by \tcode{pm} does not exist for the entire remaining
8897+
is undefined if the contained pointer \exposid{pm} is not null and the lockable
8898+
object pointed to by \exposid{pm} does not exist for the entire remaining
88998899
lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied
89008900
\tcode{Mutex} type shall meet the \oldconcept{SharedLockable}
89018901
requirements\iref{thread.req.lockable.shared}.
@@ -8920,7 +8920,7 @@
89208920
\begin{itemdescr}
89218921
\pnum
89228922
\ensures
8923-
\tcode{pm == nullptr} and \tcode{owns == false}.
8923+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
89248924
\end{itemdescr}
89258925

89268926
\indexlibraryctor{shared_lock}%
@@ -8935,7 +8935,7 @@
89358935

89368936
\pnum
89378937
\ensures
8938-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8938+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89398939
\end{itemdescr}
89408940

89418941
\indexlibraryctor{shared_lock}%
@@ -8946,7 +8946,7 @@
89468946
\begin{itemdescr}
89478947
\pnum
89488948
\ensures
8949-
\tcode{pm == addressof(m)} and \tcode{owns == false}.
8949+
\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}.
89508950
\end{itemdescr}
89518951

89528952
\indexlibraryctor{shared_lock}%
@@ -8961,7 +8961,7 @@
89618961

89628962
\pnum
89638963
\ensures
8964-
\tcode{pm == addressof(m)} and \tcode{owns == res}
8964+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
89658965
where \tcode{res} is the
89668966
value returned by the call to \tcode{m.try_lock_shared()}.
89678967
\end{itemdescr}
@@ -8978,7 +8978,7 @@
89788978

89798979
\pnum
89808980
\ensures
8981-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8981+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89828982
\end{itemdescr}
89838983

89848984
\indexlibraryctor{shared_lock}%
@@ -9000,7 +9000,7 @@
90009000

90019001
\pnum
90029002
\ensures
9003-
\tcode{pm == addressof(m)} and \tcode{owns == res}
9003+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
90049004
where \tcode{res}
90059005
is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}.
90069006
\end{itemdescr}
@@ -9024,7 +9024,7 @@
90249024

90259025
\pnum
90269026
\ensures
9027-
\tcode{pm == addressof(m)} and \tcode{owns == res}
9027+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
90289028
where \tcode{res} is
90299029
the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}.
90309030
\end{itemdescr}
@@ -9037,7 +9037,7 @@
90379037
\begin{itemdescr}
90389038
\pnum
90399039
\effects
9040-
If \tcode{owns} calls \tcode{pm->unlock_shared()}.
9040+
If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}.
90419041
\end{itemdescr}
90429042

90439043
\indexlibraryctor{shared_lock}%
@@ -9048,9 +9048,9 @@
90489048
\begin{itemdescr}
90499049
\pnum
90509050
\ensures
9051-
\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where
9051+
\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where
90529052
\tcode{sl_p} is the state of \tcode{sl} just prior to this construction),
9053-
\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}.
9053+
\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}.
90549054
\end{itemdescr}
90559055

90569056
\indexlibrarymember{operator=}{shared_lock}%
@@ -9078,22 +9078,22 @@
90789078
\begin{itemdescr}
90799079
\pnum
90809080
\effects
9081-
As if by \tcode{pm->lock_shared()}.
9081+
As if by \tcode{\exposid{pm}->lock_shared()}.
90829082

90839083
\pnum
90849084
\ensures
9085-
\tcode{owns == true}.
9085+
\tcode{\exposid{owns} == true}.
90869086

90879087
\pnum
90889088
\throws
9089-
Any exception thrown by \tcode{pm->lock_shared()}.
9089+
Any exception thrown by \tcode{\exposid{pm}->lock_shared()}.
90909090
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
90919091

90929092
\pnum
90939093
\errors
90949094
\begin{itemize}
9095-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9096-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9095+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9096+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
90979097
\tcode{true}.
90989098
\end{itemize}
90999099
\end{itemdescr}
@@ -9106,27 +9106,27 @@
91069106
\begin{itemdescr}
91079107
\pnum
91089108
\effects
9109-
As if by \tcode{pm->try_lock_shared()}.
9109+
As if by \tcode{\exposid{pm}->try_lock_shared()}.
91109110

91119111
\pnum
91129112
\ensures
9113-
\tcode{owns == res}, where \tcode{res} is the value returned by
9114-
the call to \tcode{pm->try_lock_shared()}.
9113+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
9114+
the call to \tcode{\exposid{pm}->try_lock_shared()}.
91159115

91169116
\pnum
91179117
\returns
9118-
The value returned by the call to \tcode{pm->try_lock_shared()}.
9118+
The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}.
91199119

91209120
\pnum
91219121
\throws
9122-
Any exception thrown by \tcode{pm->try_lock_shared()}.
9122+
Any exception thrown by \tcode{\exposid{pm}->try_lock_shared()}.
91239123
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
91249124

91259125
\pnum
91269126
\errors
91279127
\begin{itemize}
9128-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9129-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9128+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9129+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91309130
\tcode{true}.
91319131
\end{itemize}
91329132
\end{itemdescr}
@@ -9145,28 +9145,28 @@
91459145

91469146
\pnum
91479147
\effects
9148-
As if by \tcode{pm->try_lock_shared_until(abs_time)}.
9148+
As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91499149

91509150
\pnum
91519151
\ensures
9152-
\tcode{owns == res}, where \tcode{res} is the value returned by
9153-
the call to \tcode{pm->try_lock_shared_until(abs_time)}.
9152+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
9153+
the call to \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91549154

91559155
\pnum
91569156
\returns
91579157
The value returned by the call to
9158-
\tcode{pm->try_lock_shared_until(abs_time)}.
9158+
\tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91599159

91609160
\pnum
91619161
\throws
9162-
Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}.
9162+
Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91639163
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
91649164

91659165
\pnum
91669166
\errors
91679167
\begin{itemize}
9168-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9169-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9168+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9169+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91709170
\tcode{true}.
91719171
\end{itemize}
91729172
\end{itemdescr}
@@ -9185,25 +9185,25 @@
91859185

91869186
\pnum
91879187
\effects
9188-
As if by \tcode{pm->try_lock_shared_for(rel_time)}.
9188+
As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91899189

91909190
\pnum
91919191
\ensures
9192-
\tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}.
9192+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91939193

91949194
\pnum
91959195
\returns
9196-
The value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}.
9196+
The value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91979197

91989198
\pnum
91999199
\throws
9200-
Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}.
9200+
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}.
92019201

92029202
\pnum
92039203
\errors
92049204
\begin{itemize}
9205-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9206-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9205+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9206+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
92079207
\tcode{true}.
92089208
\end{itemize}
92099209
\end{itemdescr}
@@ -9216,11 +9216,11 @@
92169216
\begin{itemdescr}
92179217
\pnum
92189218
\effects
9219-
As if by \tcode{pm->unlock_shared()}.
9219+
As if by \tcode{\exposid{pm}->unlock_shared()}.
92209220

92219221
\pnum
92229222
\ensures
9223-
\tcode{owns == false}.
9223+
\tcode{\exposid{owns} == false}.
92249224

92259225
\pnum
92269226
\throws
@@ -9229,7 +9229,7 @@
92299229
\pnum
92309230
\errors
92319231
\begin{itemize}
9232-
\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is
9232+
\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is
92339233
\tcode{false}.
92349234
\end{itemize}
92359235
\end{itemdescr}
@@ -9255,11 +9255,11 @@
92559255
\begin{itemdescr}
92569256
\pnum
92579257
\ensures
9258-
\tcode{pm == nullptr} and \tcode{owns == false}.
9258+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
92599259

92609260
\pnum
92619261
\returns
9262-
The previous value of \tcode{pm}.
9262+
The previous value of \exposid{pm}.
92639263
\end{itemdescr}
92649264

92659265
\indexlibrarymember{swap}{shared_lock}%
@@ -9284,7 +9284,7 @@
92849284
\begin{itemdescr}
92859285
\pnum
92869286
\returns
9287-
\tcode{owns}.
9287+
\exposid{owns}.
92889288
\end{itemdescr}
92899289

92909290
\indexlibrarymember{operator bool}{shared_lock}%
@@ -9295,7 +9295,7 @@
92959295
\begin{itemdescr}
92969296
\pnum
92979297
\returns
9298-
\tcode{owns}.
9298+
\exposid{owns}.
92999299
\end{itemdescr}
93009300

93019301
\indexlibrarymember{mutex}{shared_lock}%
@@ -9306,7 +9306,7 @@
93069306
\begin{itemdescr}
93079307
\pnum
93089308
\returns
9309-
\tcode{pm}.
9309+
\exposid{pm}.
93109310
\end{itemdescr}
93119311

93129312
\rSec2[thread.lock.algorithm]{Generic locking algorithms}

0 commit comments

Comments
 (0)