Skip to content

Commit cfac6c1

Browse files
[thread.lock.unique] Exposition-only style for pm and owns
1 parent 77c56aa commit cfac6c1

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
@@ -8371,8 +8371,8 @@
83718371
mutex_type* mutex() const noexcept;
83728372

83738373
private:
8374-
mutex_type* pm; // \expos
8375-
bool owns; // \expos
8374+
mutex_type* @\exposid{pm}@; // \expos
8375+
bool @\exposid{owns}@; // \expos
83768376
};
83778377
}
83788378
\end{codeblock}
@@ -8383,8 +8383,8 @@
83838383
construction or after construction, and may be transferred, after
83848384
acquisition, to another \tcode{unique_lock} object. Objects of type \tcode{unique_lock} are not
83858385
copyable but are movable. The behavior of a program is undefined if the contained pointer
8386-
\tcode{pm} is not null and the lockable object pointed
8387-
to by \tcode{pm} does not exist for the entire remaining
8386+
\exposid{pm} is not null and the lockable object pointed
8387+
to by \exposid{pm} does not exist for the entire remaining
83888388
lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied
83898389
\tcode{Mutex} type shall meet the \oldconcept{BasicLockable}
83908390
requirements\iref{thread.req.lockable.basic}.
@@ -8409,7 +8409,7 @@
84098409
\begin{itemdescr}
84108410
\pnum
84118411
\ensures
8412-
\tcode{pm == nullptr} and \tcode{owns == false}.
8412+
\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}.
84138413
\end{itemdescr}
84148414

84158415
\indexlibraryctor{unique_lock}%
@@ -8424,7 +8424,7 @@
84248424

84258425
\pnum
84268426
\ensures
8427-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8427+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
84288428
\end{itemdescr}
84298429

84308430
\indexlibraryctor{unique_lock}%
@@ -8435,7 +8435,7 @@
84358435
\begin{itemdescr}
84368436
\pnum
84378437
\ensures
8438-
\tcode{pm == addressof(m)} and \tcode{owns == false}.
8438+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == false}.
84398439
\end{itemdescr}
84408440

84418441
\indexlibraryctor{unique_lock}%
@@ -8455,7 +8455,7 @@
84558455

84568456
\pnum
84578457
\ensures
8458-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8458+
\tcode{\exposid{pm} == addressof(m)} and \tcode{o\exposid{owns}wns == res},
84598459
where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}.
84608460
\end{itemdescr}
84618461

@@ -8471,7 +8471,7 @@
84718471

84728472
\pnum
84738473
\ensures
8474-
\tcode{pm == addressof(m)} and \tcode{owns == true}.
8474+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}.
84758475

84768476
\pnum
84778477
\throws
@@ -8496,7 +8496,7 @@
84968496

84978497
\pnum
84988498
\ensures
8499-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8499+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res},
85008500
where \tcode{res} is
85018501
the value returned by the call to \tcode{m.try_lock_until(abs_time)}.
85028502
\end{itemdescr}
@@ -8518,7 +8518,7 @@
85188518

85198519
\pnum
85208520
\ensures
8521-
\tcode{pm == addressof(m)} and \tcode{owns == res},
8521+
\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res},
85228522
where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}.
85238523
\end{itemdescr}
85248524

@@ -8530,7 +8530,7 @@
85308530
\begin{itemdescr}
85318531
\pnum
85328532
\ensures
8533-
\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}.
8533+
\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}.
85348534
\end{itemdescr}
85358535

85368536
\indexlibrarymember{operator=}{unique_lock}%
@@ -8556,7 +8556,7 @@
85568556
\begin{itemdescr}
85578557
\pnum
85588558
\effects
8559-
If \tcode{owns} calls \tcode{pm->unlock()}.
8559+
If \exposid{owns} calls \tcode{\exposid{pm}->unlock()}.
85608560
\end{itemdescr}
85618561

85628562
\rSec4[thread.lock.unique.locking]{Locking}
@@ -8569,22 +8569,22 @@
85698569
\begin{itemdescr}
85708570
\pnum
85718571
\effects
8572-
As if by \tcode{pm->lock()}.
8572+
As if by \tcode{\exposid{pm}->lock()}.
85738573

85748574
\pnum
85758575
\ensures
8576-
\tcode{owns == true}.
8576+
\tcode{\exposid{owns} == true}.
85778577

85788578
\pnum
85798579
\throws
8580-
Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} when an exception
8580+
Any exception thrown by \tcode{\exposid{pm}->lock()}. \tcode{system_error} when an exception
85818581
is required\iref{thread.req.exception}.
85828582

85838583
\pnum
85848584
\errors
85858585
\begin{itemize}
8586-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8587-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
8586+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8587+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns}
85888588
is \tcode{true}.
85898589
\end{itemize}
85908590
\end{itemdescr}
@@ -8602,27 +8602,27 @@
86028602

86038603
\pnum
86048604
\effects
8605-
As if by \tcode{pm->try_lock()}.
8605+
As if by \tcode{\exposid{pm}->try_lock()}.
86068606

86078607
\pnum
86088608
\ensures
8609-
\tcode{owns == res}, where \tcode{res} is the value returned by
8610-
\tcode{pm->try_lock()}.
8609+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
8610+
\tcode{\exposid{pm}->try_lock()}.
86118611

86128612
\pnum
86138613
\returns
8614-
The value returned by \tcode{pm->try_lock()}.
8614+
The value returned by \tcode{\exposid{pm}->try_lock()}.
86158615

86168616
\pnum
86178617
\throws
8618-
Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} when an exception
8618+
Any exception thrown by \tcode{\exposid{pm}->try_lock()}. \tcode{system_error} when an exception
86198619
is required\iref{thread.req.exception}.
86208620

86218621
\pnum
86228622
\errors
86238623
\begin{itemize}
8624-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8625-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns}
8624+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8625+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns}
86268626
is \tcode{true}.
86278627
\end{itemize}
86288628
\end{itemdescr}
@@ -8641,27 +8641,27 @@
86418641

86428642
\pnum
86438643
\effects
8644-
As if by \tcode{pm->try_lock_until(abs_time)}.
8644+
As if by \tcode{\exposid{pm}->try_lock_until(abs_time)}.
86458645

86468646
\pnum
86478647
\ensures
8648-
\tcode{owns == res}, where \tcode{res} is the value returned by
8649-
\tcode{pm->try_lock_until(abs_time)}.
8648+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by
8649+
\tcode{\exposid{pm}->try_lock_until(abs_time)}.
86508650

86518651
\pnum
86528652
\returns
8653-
The value returned by \tcode{pm->try_lock_until(abs_time)}.
8653+
The value returned by \tcode{\exposid{pm}->try_lock_until(abs_time)}.
86548654

86558655
\pnum
86568656
\throws
8657-
Any exception thrown by \tcode{pm->try_lock_until(abstime)}. \tcode{system_error} when an
8657+
Any exception thrown by \tcode{\exposid{pm}->try_lock_until(abstime)}. \tcode{system_error} when an
86588658
exception is required\iref{thread.req.exception}.
86598659

86608660
\pnum
86618661
\errors
86628662
\begin{itemize}
8663-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8664-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
8663+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8664+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
86658665
\tcode{true}.
86668666
\end{itemize}
86678667
\end{itemdescr}
@@ -8679,26 +8679,26 @@
86798679

86808680
\pnum
86818681
\effects
8682-
As if by \tcode{pm->try_lock_for(rel_time)}.
8682+
As if by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
86838683

86848684
\pnum
86858685
\ensures
8686-
\tcode{owns == res}, where \tcode{res} is the value returned by \tcode{pm->try_lock_for(rel_time)}.
8686+
\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
86878687

86888688
\pnum
86898689
\returns
8690-
The value returned by \tcode{pm->try_lock_for(rel_time)}.
8690+
The value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}.
86918691

86928692
\pnum
86938693
\throws
8694-
Any exception thrown by \tcode{pm->try_lock_for(rel_time)}. \tcode{system_error} when an
8694+
Any exception thrown by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \tcode{system_error} when an
86958695
exception is required\iref{thread.req.exception}.
86968696

86978697
\pnum
86988698
\errors
86998699
\begin{itemize}
8700-
\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}.
8701-
\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is
8700+
\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}.
8701+
\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is
87028702
\tcode{true}.
87038703
\end{itemize}
87048704
\end{itemdescr}
@@ -8711,11 +8711,11 @@
87118711
\begin{itemdescr}
87128712
\pnum
87138713
\effects
8714-
As if by \tcode{pm->unlock()}.
8714+
As if by \tcode{\exposid{pm}->unlock()}.
87158715

87168716
\pnum
87178717
\ensures
8718-
\tcode{owns == false}.
8718+
\tcode{\exposid{owns} == false}.
87198719

87208720
\pnum
87218721
\throws
@@ -8725,7 +8725,7 @@
87258725
\pnum
87268726
\errors
87278727
\begin{itemize}
8728-
\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is \tcode{false}.
8728+
\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is \tcode{false}.
87298729
\end{itemize}
87308730
\end{itemdescr}
87318731

@@ -8750,11 +8750,11 @@
87508750
\begin{itemdescr}
87518751
\pnum
87528752
\ensures
8753-
\tcode{pm == 0} and \tcode{owns == false}.
8753+
\tcode{\exposid{pm} == 0} and \tcode{\exposid{owns} == false}.
87548754

87558755
\pnum
87568756
\returns
8757-
The previous value of \tcode{pm}.
8757+
The previous value of \exposid{pm}.
87588758
\end{itemdescr}
87598759

87608760
\indexlibrarymember{swap}{unique_lock}%
@@ -8779,7 +8779,7 @@
87798779
\begin{itemdescr}
87808780
\pnum
87818781
\returns
8782-
\tcode{owns}.
8782+
\exposid{owns}.
87838783
\end{itemdescr}
87848784

87858785
\indexlibrarymember{operator bool}{unique_lock}%
@@ -8801,7 +8801,7 @@
88018801
\begin{itemdescr}
88028802
\pnum
88038803
\returns
8804-
\tcode{pm}.
8804+
\exposid{pm}.
88058805
\end{itemdescr}
88068806

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

0 commit comments

Comments
 (0)