Skip to content

Commit 3db3328

Browse files
[thread.sema.cnt] Exposition-only style for counter
1 parent 87f98d0 commit 3db3328

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

source/threads.tex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10492,7 +10492,7 @@
1049210492
bool try_acquire_until(const chrono::time_point<Clock, Duration>& abs_time);
1049310493

1049410494
private:
10495-
ptrdiff_t counter; // \expos
10495+
ptrdiff_t @\exposid{counter}@; // \expos
1049610496
};
1049710497
}
1049810498
\end{codeblock}
@@ -10522,7 +10522,7 @@
1052210522
\begin{itemdescr}
1052310523
\pnum
1052410524
\returns
10525-
The maximum value of \tcode{counter}.
10525+
The maximum value of \exposid{counter}.
1052610526
This value is greater than or equal to \tcode{least_max_value}.
1052710527
\end{itemdescr}
1052810528

@@ -10539,7 +10539,7 @@
1053910539

1054010540
\pnum
1054110541
\effects
10542-
Initializes \tcode{counter} with \tcode{desired}.
10542+
Initializes \exposid{counter} with \tcode{desired}.
1054310543

1054410544
\pnum
1054510545
\throws
@@ -10555,13 +10555,13 @@
1055510555
\pnum
1055610556
\expects
1055710557
\tcode{update >= 0} is \tcode{true}, and
10558-
\tcode{update <= max() - counter} is \tcode{true}.
10558+
\tcode{update <= max() - \exposid{counter}} is \tcode{true}.
1055910559

1056010560
\pnum
1056110561
\effects
10562-
Atomically execute \tcode{counter += update}.
10562+
Atomically execute \tcode{\exposid{counter} += update}.
1056310563
Then, unblocks any threads
10564-
that are waiting for \tcode{counter} to be greater than zero.
10564+
that are waiting for \exposid{counter} to be greater than zero.
1056510565

1056610566
\pnum
1056710567
\sync
@@ -10586,11 +10586,11 @@
1058610586
\begin{itemdescr}
1058710587
\pnum
1058810588
\effects
10589-
Attempts to atomically decrement \tcode{counter} if it is positive,
10589+
Attempts to atomically decrement \exposid{counter} if it is positive,
1059010590
without blocking.
10591-
If \tcode{counter} is not decremented, there is no effect and
10591+
If \exposid{counter} is not decremented, there is no effect and
1059210592
\tcode{try_acquire} immediately returns.
10593-
An implementation may fail to decrement \tcode{counter}
10593+
An implementation may fail to decrement \exposid{counter}
1059410594
even if it is positive.
1059510595
\begin{note}
1059610596
This spurious failure is normally uncommon, but
@@ -10603,7 +10603,7 @@
1060310603

1060410604
\pnum
1060510605
\returns
10606-
\tcode{true} if \tcode{counter} was decremented, otherwise \tcode{false}.
10606+
\tcode{true} if \exposid{counter} was decremented, otherwise \tcode{false}.
1060710607
\end{itemdescr}
1060810608

1060910609
\indexlibrarymember{acquire}{counting_semaphore}%
@@ -10619,7 +10619,7 @@
1061910619
\item Evaluates \tcode{try_acquire()}. If the result is \tcode{true}, returns.
1062010620
\item
1062110621
\indextext{block (execution)}%
10622-
Blocks on \tcode{*this} until \tcode{counter} is greater than zero.
10622+
Blocks on \tcode{*this} until \exposid{counter} is greater than zero.
1062310623
\end{itemize}
1062410624

1062510625
\pnum
@@ -10652,7 +10652,7 @@
1065210652
\item
1065310653
\indextext{block (execution)}%
1065410654
Blocks on \tcode{*this}
10655-
until \tcode{counter} is greater than zero or until the timeout expires.
10655+
until \exposid{counter} is greater than zero or until the timeout expires.
1065610656
If it is unblocked by the timeout expiring, returns \tcode{false}.
1065710657
\end{itemize}
1065810658
The timeout expires\iref{thread.req.timing}

0 commit comments

Comments
 (0)