|
6485 | 6485 | \begin{itemdescr} |
6486 | 6486 | \pnum |
6487 | 6487 | \ensures |
6488 | | -\exposid{count} is \tcode{0} and \exposid{state} is \exposid{starting}. |
| 6488 | +The \tcode{run_loop} instance's count is 0 and |
| 6489 | +its state is starting. |
6489 | 6490 | \end{itemdescr} |
6490 | 6491 |
|
6491 | 6492 | \indexlibrarydtor{run_loop}% |
|
6496 | 6497 | \begin{itemdescr} |
6497 | 6498 | \pnum |
6498 | 6499 | \effects |
6499 | | -If \exposid{count} is not \tcode{0} or if \exposid{state} is \exposid{running}, |
| 6500 | +If the \tcode{run_loop} instance's count is not 0 or |
| 6501 | +if its state is running, |
6500 | 6502 | invokes \tcode{terminate}\iref{except.terminate}. |
6501 | 6503 | Otherwise, has no effects. |
6502 | 6504 | \end{itemdescr} |
|
6513 | 6515 | Blocks\iref{defns.block} until one of the following conditions is \tcode{true}: |
6514 | 6516 | \begin{itemize} |
6515 | 6517 | \item |
6516 | | -\exposid{count} is \tcode{0} and \exposid{state} is \exposid{finishing}, |
6517 | | -in which case \exposid{pop-front} sets \exposid{state} to \exposid{finished} |
| 6518 | +The \tcode{run_loop} instance's count is 0 and its state is finishing, |
| 6519 | +in which case \exposid{pop-front} sets the state to finished |
6518 | 6520 | and returns \tcode{nullptr}; or |
6519 | 6521 | \item |
6520 | | -\exposid{count} is greater than \tcode{0}, |
| 6522 | +the \tcode{run_loop} instance's count is greater than 0, |
6521 | 6523 | in which case an item is removed from the front of the queue, |
6522 | | -\exposid{count} is decremented by \tcode{1}, and |
| 6524 | +the count is decremented by \tcode{1}, and |
6523 | 6525 | the removed item is returned. |
6524 | 6526 | \end{itemize} |
6525 | 6527 | \end{itemdescr} |
|
6532 | 6534 | \pnum |
6533 | 6535 | \effects |
6534 | 6536 | Adds \tcode{item} to the back of the queue and |
6535 | | -increments \exposid{count} by \tcode{1}. |
| 6537 | +increments the \tcode{run_loop} instance's count by 1.. |
6536 | 6538 |
|
6537 | 6539 | \pnum |
6538 | 6540 | \sync |
|
6560 | 6562 | \begin{itemdescr} |
6561 | 6563 | \pnum |
6562 | 6564 | \expects |
6563 | | -\exposid{state} is either \exposid{starting} or \exposid{finishing}. |
| 6565 | +The \tcode{run_loop} instance's state is either starting or finishing. |
6564 | 6566 |
|
6565 | 6567 | \pnum |
6566 | 6568 | \effects |
6567 | | -If \exposid{state} is \exposid{starting}, |
6568 | | -sets the \exposid{state} to \exposid{running}, |
6569 | | -otherwise leaves \exposid{state} unchanged. |
| 6569 | +If the \tcode{run_loop} instance's state is starting, |
| 6570 | +sets the state to running, |
| 6571 | +otherwise leaves the state unchanged. |
6570 | 6572 | Then, equivalent to: |
6571 | 6573 | \begin{codeblock} |
6572 | 6574 | while (auto* op = @\exposid{pop-front}@()) { |
|
6576 | 6578 |
|
6577 | 6579 | \pnum |
6578 | 6580 | \remarks |
6579 | | -When \exposid{state} changes, it does so without introducing data races. |
| 6581 | +When the \tcode{run_loop} instance's state changes, |
| 6582 | +it does so without introducing data races. |
6580 | 6583 | \end{itemdescr} |
6581 | 6584 |
|
6582 | 6585 | \indexlibrarymember{finish}{run_loop}% |
|
6587 | 6590 | \begin{itemdescr} |
6588 | 6591 | \pnum |
6589 | 6592 | \expects |
6590 | | -\exposid{state} is either \exposid{starting} or \exposid{running}. |
| 6593 | +The \tcode{run_loop} instance's state is either starting or running. |
6591 | 6594 |
|
6592 | 6595 | \pnum |
6593 | 6596 | \effects |
6594 | | -Changes \exposid{state} to \exposid{finishing}. |
| 6597 | +Changes the \tcode{run_loop} instance's state to finishing. |
6595 | 6598 |
|
6596 | 6599 | \pnum |
6597 | 6600 | \sync |
|
0 commit comments