Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6489,7 +6489,8 @@
\begin{itemdescr}
\pnum
\ensures
\exposid{count} is \tcode{0} and \exposid{state} is \exposid{starting}.
The \tcode{run_loop} instance's count is 0 and
its state is starting.
\end{itemdescr}

\indexlibrarydtor{run_loop}%
Expand All @@ -6500,7 +6501,8 @@
\begin{itemdescr}
\pnum
\effects
If \exposid{count} is not \tcode{0} or if \exposid{state} is \exposid{running},
If the \tcode{run_loop} instance's count is not 0 or
if its state is running,
invokes \tcode{terminate}\iref{except.terminate}.
Otherwise, has no effects.
\end{itemdescr}
Expand All @@ -6517,13 +6519,13 @@
Blocks\iref{defns.block} until one of the following conditions is \tcode{true}:
\begin{itemize}
\item
\exposid{count} is \tcode{0} and \exposid{state} is \exposid{finishing},
in which case \exposid{pop-front} sets \exposid{state} to \exposid{finished}
The \tcode{run_loop} instance's count is 0 and its state is finishing,
in which case \exposid{pop-front} sets the state to finished
and returns \tcode{nullptr}; or
\item
\exposid{count} is greater than \tcode{0},
the \tcode{run_loop} instance's count is greater than 0,
in which case an item is removed from the front of the queue,
\exposid{count} is decremented by \tcode{1}, and
the count is decremented by \tcode{1}, and
the removed item is returned.
\end{itemize}
\end{itemdescr}
Expand All @@ -6536,7 +6538,7 @@
\pnum
\effects
Adds \tcode{item} to the back of the queue and
increments \exposid{count} by \tcode{1}.
increments the \tcode{run_loop} instance's count by 1..

\pnum
\sync
Expand Down Expand Up @@ -6564,13 +6566,13 @@
\begin{itemdescr}
\pnum
\expects
\exposid{state} is either \exposid{starting} or \exposid{finishing}.
The \tcode{run_loop} instance's state is either starting or finishing.

\pnum
\effects
If \exposid{state} is \exposid{starting},
sets the \exposid{state} to \exposid{running},
otherwise leaves \exposid{state} unchanged.
If the \tcode{run_loop} instance's state is starting,
sets its state to running,
otherwise leaves its state unchanged.
Then, equivalent to:
\begin{codeblock}
while (auto* op = @\exposid{pop-front}@()) {
Expand All @@ -6580,7 +6582,8 @@

\pnum
\remarks
When \exposid{state} changes, it does so without introducing data races.
When the \tcode{run_loop} instance's state changes,
it does so without introducing data races.
\end{itemdescr}

\indexlibrarymember{finish}{run_loop}%
Expand All @@ -6591,11 +6594,11 @@
\begin{itemdescr}
\pnum
\expects
\exposid{state} is either \exposid{starting} or \exposid{running}.
The \tcode{run_loop} instance's state is either starting or running.

\pnum
\effects
Changes \exposid{state} to \exposid{finishing}.
Changes the \tcode{run_loop} instance's state to finishing.

\pnum
\sync
Expand Down