Skip to content

Commit 87f98d0

Browse files
[thread.lock.shared] Exposition-only style for pm and owns
1 parent 9870f5d commit 87f98d0

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
@@ -8881,8 +8881,8 @@
88818881
mutex_type* mutex() const noexcept;
88828882

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

89258925
\indexlibraryctor{shared_lock}%
@@ -8934,7 +8934,7 @@
89348934

89358935
\pnum
89368936
\ensures
8937-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8937+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89388938
\end{itemdescr}
89398939

89408940
\indexlibraryctor{shared_lock}%
@@ -8945,7 +8945,7 @@
89458945
\begin{itemdescr}
89468946
\pnum
89478947
\ensures
8948-
\tcode{pm == addressof(m)} and \tcode{owns == false}.
8948+
\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}.
89498949
\end{itemdescr}
89508950

89518951
\indexlibraryctor{shared_lock}%
@@ -8960,7 +8960,7 @@
89608960

89618961
\pnum
89628962
\ensures
8963-
\tcode{pm == addressof(m)} and \tcode{owns == res}
8963+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
89648964
where \tcode{res} is the
89658965
value returned by the call to \tcode{m.try_lock_shared()}.
89668966
\end{itemdescr}
@@ -8977,7 +8977,7 @@
89778977

89788978
\pnum
89798979
\ensures
8980-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8980+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89818981
\end{itemdescr}
89828982

89838983
\indexlibraryctor{shared_lock}%
@@ -8999,7 +8999,7 @@
89998999

90009000
\pnum
90019001
\ensures
9002-
\tcode{pm == addressof(m)} and \tcode{owns == res}
9002+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
90039003
where \tcode{res}
90049004
is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}.
90059005
\end{itemdescr}
@@ -9023,7 +9023,7 @@
90239023

90249024
\pnum
90259025
\ensures
9026-
\tcode{pm == addressof(m)} and \tcode{owns == res}
9026+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
90279027
where \tcode{res} is
90289028
the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}.
90299029
\end{itemdescr}
@@ -9036,7 +9036,7 @@
90369036
\begin{itemdescr}
90379037
\pnum
90389038
\effects
9039-
If \tcode{owns} calls \tcode{pm->unlock_shared()}.
9039+
If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}.
90409040
\end{itemdescr}
90419041

90429042
\indexlibraryctor{shared_lock}%
@@ -9047,9 +9047,9 @@
90479047
\begin{itemdescr}
90489048
\pnum
90499049
\ensures
9050-
\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where
9050+
\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where
90519051
\tcode{sl_p} is the state of \tcode{sl} just prior to this construction),
9052-
\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}.
9052+
\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}.
90539053
\end{itemdescr}
90549054

90559055
\indexlibrarymember{operator=}{shared_lock}%
@@ -9077,22 +9077,22 @@
90779077
\begin{itemdescr}
90789078
\pnum
90799079
\effects
9080-
As if by \tcode{pm->lock_shared()}.
9080+
As if by \tcode{\exposid{pm}->lock_shared()}.
90819081

90829082
\pnum
90839083
\ensures
9084-
\tcode{owns == true}.
9084+
\tcode{\exposid{owns} == true}.
90859085

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

90919091
\pnum
90929092
\errors
90939093
\begin{itemize}
9094-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9095-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9094+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9095+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
90969096
\tcode{true}.
90979097
\end{itemize}
90989098
\end{itemdescr}
@@ -9105,27 +9105,27 @@
91059105
\begin{itemdescr}
91069106
\pnum
91079107
\effects
9108-
As if by \tcode{pm->try_lock_shared()}.
9108+
As if by \tcode{\exposid{pm}->try_lock_shared()}.
91099109

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

91159115
\pnum
91169116
\returns
9117-
The value returned by the call to \tcode{pm->try_lock_shared()}.
9117+
The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}.
91189118

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

91249124
\pnum
91259125
\errors
91269126
\begin{itemize}
9127-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9128-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9127+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9128+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91299129
\tcode{true}.
91309130
\end{itemize}
91319131
\end{itemdescr}
@@ -9144,28 +9144,28 @@
91449144

91459145
\pnum
91469146
\effects
9147-
As if by \tcode{pm->try_lock_shared_until(abs_time)}.
9147+
As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91489148

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

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

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

91649164
\pnum
91659165
\errors
91669166
\begin{itemize}
9167-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9168-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9167+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9168+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91699169
\tcode{true}.
91709170
\end{itemize}
91719171
\end{itemdescr}
@@ -9184,25 +9184,25 @@
91849184

91859185
\pnum
91869186
\effects
9187-
As if by \tcode{pm->try_lock_shared_for(rel_time)}.
9187+
As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91889188

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

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

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

92019201
\pnum
92029202
\errors
92039203
\begin{itemize}
9204-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9205-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9204+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9205+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
92069206
\tcode{true}.
92079207
\end{itemize}
92089208
\end{itemdescr}
@@ -9215,11 +9215,11 @@
92159215
\begin{itemdescr}
92169216
\pnum
92179217
\effects
9218-
As if by \tcode{pm->unlock_shared()}.
9218+
As if by \tcode{\exposid{pm}->unlock_shared()}.
92199219

92209220
\pnum
92219221
\ensures
9222-
\tcode{owns == false}.
9222+
\tcode{\exposid{owns} == false}.
92239223

92249224
\pnum
92259225
\throws
@@ -9228,7 +9228,7 @@
92289228
\pnum
92299229
\errors
92309230
\begin{itemize}
9231-
\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is
9231+
\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is
92329232
\tcode{false}.
92339233
\end{itemize}
92349234
\end{itemdescr}
@@ -9254,11 +9254,11 @@
92549254
\begin{itemdescr}
92559255
\pnum
92569256
\ensures
9257-
\tcode{pm == nullptr} and \tcode{owns == false}.
9257+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
92589258

92599259
\pnum
92609260
\returns
9261-
The previous value of \tcode{pm}.
9261+
The previous value of \exposid{pm}.
92629262
\end{itemdescr}
92639263

92649264
\indexlibrarymember{swap}{shared_lock}%
@@ -9283,7 +9283,7 @@
92839283
\begin{itemdescr}
92849284
\pnum
92859285
\returns
9286-
\tcode{owns}.
9286+
\exposid{owns}.
92879287
\end{itemdescr}
92889288

92899289
\indexlibrarymember{operator bool}{shared_lock}%
@@ -9294,7 +9294,7 @@
92949294
\begin{itemdescr}
92959295
\pnum
92969296
\returns
9297-
\tcode{owns}.
9297+
\exposid{owns}.
92989298
\end{itemdescr}
92999299

93009300
\indexlibrarymember{mutex}{shared_lock}%
@@ -9305,7 +9305,7 @@
93059305
\begin{itemdescr}
93069306
\pnum
93079307
\returns
9308-
\tcode{pm}.
9308+
\exposid{pm}.
93099309
\end{itemdescr}
93109310

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

0 commit comments

Comments
 (0)