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