Skip to content

Commit 9870f5d

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

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

source/threads.tex

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8399,8 +8399,8 @@
83998399
mutex_type* mutex() const noexcept;
84008400

84018401
private:
8402-
mutex_type* pm; // \expos
8403-
bool owns; // \expos
8402+
mutex_type* @\exposid{pm}@; // \expos
8403+
bool @\exposid{owns}@; // \expos
84048404
};
84058405
}
84068406
\end{codeblock}
@@ -8411,8 +8411,8 @@
84118411
construction or after construction, and may be transferred, after
84128412
acquisition, to another \tcode{unique_lock} object. Objects of type \tcode{unique_lock} are not
84138413
copyable but are movable. The behavior of a program is undefined if the contained pointer
8414-
\tcode{pm} is not null and the lockable object pointed
8415-
to by \tcode{pm} does not exist for the entire remaining
8414+
\exposid{pm} is not null and the lockable object pointed
8415+
to by \exposid{pm} does not exist for the entire remaining
84168416
lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied
84178417
\tcode{Mutex} type shall meet the \oldconcept{BasicLockable}
84188418
requirements\iref{thread.req.lockable.basic}.
@@ -8437,7 +8437,7 @@
84378437
\begin{itemdescr}
84388438
\pnum
84398439
\ensures
8440-
\tcode{pm == nullptr} and \tcode{owns == false}.
8440+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
84418441
\end{itemdescr}
84428442

84438443
\indexlibraryctor{unique_lock}%
@@ -8452,7 +8452,7 @@
84528452

84538453
\pnum
84548454
\ensures
8455-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8455+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
84568456
\end{itemdescr}
84578457

84588458
\indexlibraryctor{unique_lock}%
@@ -8463,7 +8463,7 @@
84638463
\begin{itemdescr}
84648464
\pnum
84658465
\ensures
8466-
\tcode{pm == addressof(m)} and \tcode{owns == false}.
8466+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == false}.
84678467
\end{itemdescr}
84688468

84698469
\indexlibraryctor{unique_lock}%
@@ -8483,7 +8483,7 @@
84838483

84848484
\pnum
84858485
\ensures
8486-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8486+
\tcode{\exposid{pm} == addressof(m)} and \tcode{o\exposid{owns}wns == res},
84878487
where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}.
84888488
\end{itemdescr}
84898489

@@ -8499,7 +8499,7 @@
84998499

85008500
\pnum
85018501
\ensures
8502-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8502+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
85038503

85048504
\pnum
85058505
\throws
@@ -8524,7 +8524,7 @@
85248524

85258525
\pnum
85268526
\ensures
8527-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8527+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res},
85288528
where \tcode{res} is
85298529
the value returned by the call to \tcode{m.try_lock_until(abs_time)}.
85308530
\end{itemdescr}
@@ -8546,7 +8546,7 @@
85468546

85478547
\pnum
85488548
\ensures
8549-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8549+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res},
85508550
where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}.
85518551
\end{itemdescr}
85528552

@@ -8558,7 +8558,7 @@
85588558
\begin{itemdescr}
85598559
\pnum
85608560
\ensures
8561-
\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}.
8561+
\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}.
85628562
\end{itemdescr}
85638563

85648564
\indexlibrarymember{operator=}{unique_lock}%
@@ -8584,7 +8584,7 @@
85848584
\begin{itemdescr}
85858585
\pnum
85868586
\effects
8587-
If \tcode{owns} calls \tcode{pm->unlock()}.
8587+
If \exposid{owns} calls \tcode{\exposid{pm}->unlock()}.
85888588
\end{itemdescr}
85898589

85908590
\rSec4[thread.lock.unique.locking]{Locking}
@@ -8597,22 +8597,22 @@
85978597
\begin{itemdescr}
85988598
\pnum
85998599
\effects
8600-
As if by \tcode{pm->lock()}.
8600+
As if by \tcode{\exposid{pm}->lock()}.
86018601

86028602
\pnum
86038603
\ensures
8604-
\tcode{owns == true}.
8604+
\tcode{\exposid{owns} == true}.
86058605

86068606
\pnum
86078607
\throws
8608-
Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} when an exception
8608+
Any exception thrown by \tcode{\exposid{pm}->lock()}. \tcode{system_error} when an exception
86098609
is required\iref{thread.req.exception}.
86108610

86118611
\pnum
86128612
\errors
86138613
\begin{itemize}
8614-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8615-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
8614+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8615+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns}
86168616
is \tcode{true}.
86178617
\end{itemize}
86188618
\end{itemdescr}
@@ -8630,27 +8630,27 @@
86308630

86318631
\pnum
86328632
\effects
8633-
As if by \tcode{pm->try_lock()}.
8633+
As if by \tcode{\exposid{pm}->try_lock()}.
86348634

86358635
\pnum
86368636
\ensures
8637-
\tcode{owns == res}, where \tcode{res} is the value returned by
8638-
\tcode{pm->try_lock()}.
8637+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
8638+
\tcode{\exposid{pm}->try_lock()}.
86398639

86408640
\pnum
86418641
\returns
8642-
The value returned by \tcode{pm->try_lock()}.
8642+
The value returned by \tcode{\exposid{pm}->try_lock()}.
86438643

86448644
\pnum
86458645
\throws
8646-
Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} when an exception
8646+
Any exception thrown by \tcode{\exposid{pm}->try_lock()}. \tcode{system_error} when an exception
86478647
is required\iref{thread.req.exception}.
86488648

86498649
\pnum
86508650
\errors
86518651
\begin{itemize}
8652-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8653-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
8652+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8653+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns}
86548654
is \tcode{true}.
86558655
\end{itemize}
86568656
\end{itemdescr}
@@ -8669,27 +8669,27 @@
86698669

86708670
\pnum
86718671
\effects
8672-
As if by \tcode{pm->try_lock_until(abs_time)}.
8672+
As if by \tcode{\exposid{pm}->try_lock_until(abs_time)}.
86738673

86748674
\pnum
86758675
\ensures
8676-
\tcode{owns == res}, where \tcode{res} is the value returned by
8677-
\tcode{pm->try_lock_until(abs_time)}.
8676+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
8677+
\tcode{\exposid{pm}->try_lock_until(abs_time)}.
86788678

86798679
\pnum
86808680
\returns
8681-
The value returned by \tcode{pm->try_lock_until(abs_time)}.
8681+
The value returned by \tcode{\exposid{pm}->try_lock_until(abs_time)}.
86828682

86838683
\pnum
86848684
\throws
8685-
Any exception thrown by \tcode{pm->try_lock_until(abstime)}. \tcode{system_error} when an
8685+
Any exception thrown by \tcode{\exposid{pm}->try_lock_until(abstime)}. \tcode{system_error} when an
86868686
exception is required\iref{thread.req.exception}.
86878687

86888688
\pnum
86898689
\errors
86908690
\begin{itemize}
8691-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8692-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
8691+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8692+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
86938693
\tcode{true}.
86948694
\end{itemize}
86958695
\end{itemdescr}
@@ -8707,26 +8707,26 @@
87078707

87088708
\pnum
87098709
\effects
8710-
As if by \tcode{pm->try_lock_for(rel_time)}.
8710+
As if by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
87118711

87128712
\pnum
87138713
\ensures
8714-
\tcode{owns == res}, where \tcode{res} is the value returned by \tcode{pm->try_lock_for(rel_time)}.
8714+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
87158715

87168716
\pnum
87178717
\returns
8718-
The value returned by \tcode{pm->try_lock_for(rel_time)}.
8718+
The value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
87198719

87208720
\pnum
87218721
\throws
8722-
Any exception thrown by \tcode{pm->try_lock_for(rel_time)}. \tcode{system_error} when an
8722+
Any exception thrown by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \tcode{system_error} when an
87238723
exception is required\iref{thread.req.exception}.
87248724

87258725
\pnum
87268726
\errors
87278727
\begin{itemize}
8728-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8729-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
8728+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8729+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
87308730
\tcode{true}.
87318731
\end{itemize}
87328732
\end{itemdescr}
@@ -8739,11 +8739,11 @@
87398739
\begin{itemdescr}
87408740
\pnum
87418741
\effects
8742-
As if by \tcode{pm->unlock()}.
8742+
As if by \tcode{\exposid{pm}->unlock()}.
87438743

87448744
\pnum
87458745
\ensures
8746-
\tcode{owns == false}.
8746+
\tcode{\exposid{owns} == false}.
87478747

87488748
\pnum
87498749
\throws
@@ -8753,7 +8753,7 @@
87538753
\pnum
87548754
\errors
87558755
\begin{itemize}
8756-
\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is \tcode{false}.
8756+
\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is \tcode{false}.
87578757
\end{itemize}
87588758
\end{itemdescr}
87598759

@@ -8778,11 +8778,11 @@
87788778
\begin{itemdescr}
87798779
\pnum
87808780
\ensures
8781-
\tcode{pm == 0} and \tcode{owns == false}.
8781+
\tcode{\exposid{pm} == 0} and \tcode{\exposid{owns} == false}.
87828782

87838783
\pnum
87848784
\returns
8785-
The previous value of \tcode{pm}.
8785+
The previous value of \exposid{pm}.
87868786
\end{itemdescr}
87878787

87888788
\indexlibrarymember{swap}{unique_lock}%
@@ -8807,7 +8807,7 @@
88078807
\begin{itemdescr}
88088808
\pnum
88098809
\returns
8810-
\tcode{owns}.
8810+
\exposid{owns}.
88118811
\end{itemdescr}
88128812

88138813
\indexlibrarymember{operator bool}{unique_lock}%
@@ -8829,7 +8829,7 @@
88298829
\begin{itemdescr}
88308830
\pnum
88318831
\returns
8832-
\tcode{pm}.
8832+
\exposid{pm}.
88338833
\end{itemdescr}
88348834

88358835
\rSec3[thread.lock.shared]{Class template \tcode{shared_lock}}

0 commit comments

Comments
 (0)