Skip to content

Commit 39cdfce

Browse files
[thread.lock.shared] Exposition-only style for pm and owns
1 parent cfac6c1 commit 39cdfce

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
@@ -8853,8 +8853,8 @@
88538853
mutex_type* mutex() const noexcept;
88548854

88558855
private:
8856-
mutex_type* pm; // \expos
8857-
bool owns; // \expos
8856+
mutex_type* @\exposid{pm}@; // \expos
8857+
bool @\exposid{owns}@; // \expos
88588858
};
88598859
}
88608860
\end{codeblock}
@@ -8865,8 +8865,8 @@
88658865
acquired at construction or after construction, and may be transferred, after
88668866
acquisition, to another \tcode{shared_lock} object. Objects of type
88678867
\tcode{shared_lock} are not copyable but are movable. The behavior of a program
8868-
is undefined if the contained pointer \tcode{pm} is not null and the lockable
8869-
object pointed to by \tcode{pm} does not exist for the entire remaining
8868+
is undefined if the contained pointer \exposid{pm} is not null and the lockable
8869+
object pointed to by \exposid{pm} does not exist for the entire remaining
88708870
lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied
88718871
\tcode{Mutex} type shall meet the \oldconcept{SharedLockable}
88728872
requirements\iref{thread.req.lockable.shared}.
@@ -8891,7 +8891,7 @@
88918891
\begin{itemdescr}
88928892
\pnum
88938893
\ensures
8894-
\tcode{pm == nullptr} and \tcode{owns == false}.
8894+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
88958895
\end{itemdescr}
88968896

88978897
\indexlibraryctor{shared_lock}%
@@ -8906,7 +8906,7 @@
89068906

89078907
\pnum
89088908
\ensures
8909-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8909+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89108910
\end{itemdescr}
89118911

89128912
\indexlibraryctor{shared_lock}%
@@ -8917,7 +8917,7 @@
89178917
\begin{itemdescr}
89188918
\pnum
89198919
\ensures
8920-
\tcode{pm == addressof(m)} and \tcode{owns == false}.
8920+
\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}.
89218921
\end{itemdescr}
89228922

89238923
\indexlibraryctor{shared_lock}%
@@ -8932,7 +8932,7 @@
89328932

89338933
\pnum
89348934
\ensures
8935-
\tcode{pm == addressof(m)} and \tcode{owns == res}
8935+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
89368936
where \tcode{res} is the
89378937
value returned by the call to \tcode{m.try_lock_shared()}.
89388938
\end{itemdescr}
@@ -8949,7 +8949,7 @@
89498949

89508950
\pnum
89518951
\ensures
8952-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8952+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
89538953
\end{itemdescr}
89548954

89558955
\indexlibraryctor{shared_lock}%
@@ -8971,7 +8971,7 @@
89718971

89728972
\pnum
89738973
\ensures
8974-
\tcode{pm == addressof(m)} and \tcode{owns == res}
8974+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
89758975
where \tcode{res}
89768976
is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}.
89778977
\end{itemdescr}
@@ -8995,7 +8995,7 @@
89958995

89968996
\pnum
89978997
\ensures
8998-
\tcode{pm == addressof(m)} and \tcode{owns == res}
8998+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}
89998999
where \tcode{res} is
90009000
the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}.
90019001
\end{itemdescr}
@@ -9008,7 +9008,7 @@
90089008
\begin{itemdescr}
90099009
\pnum
90109010
\effects
9011-
If \tcode{owns} calls \tcode{pm->unlock_shared()}.
9011+
If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}.
90129012
\end{itemdescr}
90139013

90149014
\indexlibraryctor{shared_lock}%
@@ -9019,9 +9019,9 @@
90199019
\begin{itemdescr}
90209020
\pnum
90219021
\ensures
9022-
\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where
9022+
\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where
90239023
\tcode{sl_p} is the state of \tcode{sl} just prior to this construction),
9024-
\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}.
9024+
\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}.
90259025
\end{itemdescr}
90269026

90279027
\indexlibrarymember{operator=}{shared_lock}%
@@ -9049,22 +9049,22 @@
90499049
\begin{itemdescr}
90509050
\pnum
90519051
\effects
9052-
As if by \tcode{pm->lock_shared()}.
9052+
As if by \tcode{\exposid{pm}->lock_shared()}.
90539053

90549054
\pnum
90559055
\ensures
9056-
\tcode{owns == true}.
9056+
\tcode{\exposid{owns} == true}.
90579057

90589058
\pnum
90599059
\throws
9060-
Any exception thrown by \tcode{pm->lock_shared()}.
9060+
Any exception thrown by \tcode{\exposid{pm}->lock_shared()}.
90619061
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
90629062

90639063
\pnum
90649064
\errors
90659065
\begin{itemize}
9066-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9067-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9066+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9067+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
90689068
\tcode{true}.
90699069
\end{itemize}
90709070
\end{itemdescr}
@@ -9077,27 +9077,27 @@
90779077
\begin{itemdescr}
90789078
\pnum
90799079
\effects
9080-
As if by \tcode{pm->try_lock_shared()}.
9080+
As if by \tcode{\exposid{pm}->try_lock_shared()}.
90819081

90829082
\pnum
90839083
\ensures
9084-
\tcode{owns == res}, where \tcode{res} is the value returned by
9085-
the call to \tcode{pm->try_lock_shared()}.
9084+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
9085+
the call to \tcode{\exposid{pm}->try_lock_shared()}.
90869086

90879087
\pnum
90889088
\returns
9089-
The value returned by the call to \tcode{pm->try_lock_shared()}.
9089+
The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}.
90909090

90919091
\pnum
90929092
\throws
9093-
Any exception thrown by \tcode{pm->try_lock_shared()}.
9093+
Any exception thrown by \tcode{\exposid{pm}->try_lock_shared()}.
90949094
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
90959095

90969096
\pnum
90979097
\errors
90989098
\begin{itemize}
9099-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9100-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9099+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9100+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91019101
\tcode{true}.
91029102
\end{itemize}
91039103
\end{itemdescr}
@@ -9116,28 +9116,28 @@
91169116

91179117
\pnum
91189118
\effects
9119-
As if by \tcode{pm->try_lock_shared_until(abs_time)}.
9119+
As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91209120

91219121
\pnum
91229122
\ensures
9123-
\tcode{owns == res}, where \tcode{res} is the value returned by
9124-
the call to \tcode{pm->try_lock_shared_until(abs_time)}.
9123+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
9124+
the call to \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91259125

91269126
\pnum
91279127
\returns
91289128
The value returned by the call to
9129-
\tcode{pm->try_lock_shared_until(abs_time)}.
9129+
\tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91309130

91319131
\pnum
91329132
\throws
9133-
Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}.
9133+
Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}.
91349134
\tcode{system_error} when an exception is required\iref{thread.req.exception}.
91359135

91369136
\pnum
91379137
\errors
91389138
\begin{itemize}
9139-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9140-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9139+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9140+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91419141
\tcode{true}.
91429142
\end{itemize}
91439143
\end{itemdescr}
@@ -9156,25 +9156,25 @@
91569156

91579157
\pnum
91589158
\effects
9159-
As if by \tcode{pm->try_lock_shared_for(rel_time)}.
9159+
As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91609160

91619161
\pnum
91629162
\ensures
9163-
\tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}.
9163+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91649164

91659165
\pnum
91669166
\returns
9167-
The value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}.
9167+
The value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}.
91689168

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

91739173
\pnum
91749174
\errors
91759175
\begin{itemize}
9176-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
9177-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
9176+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
9177+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
91789178
\tcode{true}.
91799179
\end{itemize}
91809180
\end{itemdescr}
@@ -9187,11 +9187,11 @@
91879187
\begin{itemdescr}
91889188
\pnum
91899189
\effects
9190-
As if by \tcode{pm->unlock_shared()}.
9190+
As if by \tcode{\exposid{pm}->unlock_shared()}.
91919191

91929192
\pnum
91939193
\ensures
9194-
\tcode{owns == false}.
9194+
\tcode{\exposid{owns} == false}.
91959195

91969196
\pnum
91979197
\throws
@@ -9200,7 +9200,7 @@
92009200
\pnum
92019201
\errors
92029202
\begin{itemize}
9203-
\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is
9203+
\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is
92049204
\tcode{false}.
92059205
\end{itemize}
92069206
\end{itemdescr}
@@ -9226,11 +9226,11 @@
92269226
\begin{itemdescr}
92279227
\pnum
92289228
\ensures
9229-
\tcode{pm == nullptr} and \tcode{owns == false}.
9229+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
92309230

92319231
\pnum
92329232
\returns
9233-
The previous value of \tcode{pm}.
9233+
The previous value of \exposid{pm}.
92349234
\end{itemdescr}
92359235

92369236
\indexlibrarymember{swap}{shared_lock}%
@@ -9255,7 +9255,7 @@
92559255
\begin{itemdescr}
92569256
\pnum
92579257
\returns
9258-
\tcode{owns}.
9258+
\exposid{owns}.
92599259
\end{itemdescr}
92609260

92619261
\indexlibrarymember{operator bool}{shared_lock}%
@@ -9266,7 +9266,7 @@
92669266
\begin{itemdescr}
92679267
\pnum
92689268
\returns
9269-
\tcode{owns}.
9269+
\exposid{owns}.
92709270
\end{itemdescr}
92719271

92729272
\indexlibrarymember{mutex}{shared_lock}%
@@ -9277,7 +9277,7 @@
92779277
\begin{itemdescr}
92789278
\pnum
92799279
\returns
9280-
\tcode{pm}.
9280+
\exposid{pm}.
92819281
\end{itemdescr}
92829282

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

0 commit comments

Comments
 (0)