|
8371 | 8371 | mutex_type* mutex() const noexcept; |
8372 | 8372 |
|
8373 | 8373 | private: |
8374 | | - mutex_type* pm; // \expos |
8375 | | - bool owns; // \expos |
| 8374 | + mutex_type* @\exposid{pm}@; // \expos |
| 8375 | + bool @\exposid{owns}@; // \expos |
8376 | 8376 | }; |
8377 | 8377 | } |
8378 | 8378 | \end{codeblock} |
|
8383 | 8383 | construction or after construction, and may be transferred, after |
8384 | 8384 | acquisition, to another \tcode{unique_lock} object. Objects of type \tcode{unique_lock} are not |
8385 | 8385 | 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 |
8388 | 8388 | lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied |
8389 | 8389 | \tcode{Mutex} type shall meet the \oldconcept{BasicLockable} |
8390 | 8390 | requirements\iref{thread.req.lockable.basic}. |
|
8409 | 8409 | \begin{itemdescr} |
8410 | 8410 | \pnum |
8411 | 8411 | \ensures |
8412 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 8412 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
8413 | 8413 | \end{itemdescr} |
8414 | 8414 |
|
8415 | 8415 | \indexlibraryctor{unique_lock}% |
|
8424 | 8424 |
|
8425 | 8425 | \pnum |
8426 | 8426 | \ensures |
8427 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8427 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8428 | 8428 | \end{itemdescr} |
8429 | 8429 |
|
8430 | 8430 | \indexlibraryctor{unique_lock}% |
|
8435 | 8435 | \begin{itemdescr} |
8436 | 8436 | \pnum |
8437 | 8437 | \ensures |
8438 | | -\tcode{pm == addressof(m)} and \tcode{owns == false}. |
| 8438 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == false}. |
8439 | 8439 | \end{itemdescr} |
8440 | 8440 |
|
8441 | 8441 | \indexlibraryctor{unique_lock}% |
|
8455 | 8455 |
|
8456 | 8456 | \pnum |
8457 | 8457 | \ensures |
8458 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8458 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{o\exposid{owns}wns == res}, |
8459 | 8459 | where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}. |
8460 | 8460 | \end{itemdescr} |
8461 | 8461 |
|
|
8471 | 8471 |
|
8472 | 8472 | \pnum |
8473 | 8473 | \ensures |
8474 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8474 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8475 | 8475 |
|
8476 | 8476 | \pnum |
8477 | 8477 | \throws |
|
8496 | 8496 |
|
8497 | 8497 | \pnum |
8498 | 8498 | \ensures |
8499 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8499 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, |
8500 | 8500 | where \tcode{res} is |
8501 | 8501 | the value returned by the call to \tcode{m.try_lock_until(abs_time)}. |
8502 | 8502 | \end{itemdescr} |
|
8518 | 8518 |
|
8519 | 8519 | \pnum |
8520 | 8520 | \ensures |
8521 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8521 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, |
8522 | 8522 | where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}. |
8523 | 8523 | \end{itemdescr} |
8524 | 8524 |
|
|
8530 | 8530 | \begin{itemdescr} |
8531 | 8531 | \pnum |
8532 | 8532 | \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}. |
8534 | 8534 | \end{itemdescr} |
8535 | 8535 |
|
8536 | 8536 | \indexlibrarymember{operator=}{unique_lock}% |
|
8556 | 8556 | \begin{itemdescr} |
8557 | 8557 | \pnum |
8558 | 8558 | \effects |
8559 | | -If \tcode{owns} calls \tcode{pm->unlock()}. |
| 8559 | +If \exposid{owns} calls \tcode{\exposid{pm}->unlock()}. |
8560 | 8560 | \end{itemdescr} |
8561 | 8561 |
|
8562 | 8562 | \rSec4[thread.lock.unique.locking]{Locking} |
|
8569 | 8569 | \begin{itemdescr} |
8570 | 8570 | \pnum |
8571 | 8571 | \effects |
8572 | | -As if by \tcode{pm->lock()}. |
| 8572 | +As if by \tcode{\exposid{pm}->lock()}. |
8573 | 8573 |
|
8574 | 8574 | \pnum |
8575 | 8575 | \ensures |
8576 | | -\tcode{owns == true}. |
| 8576 | +\tcode{\exposid{owns} == true}. |
8577 | 8577 |
|
8578 | 8578 | \pnum |
8579 | 8579 | \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 |
8581 | 8581 | is required\iref{thread.req.exception}. |
8582 | 8582 |
|
8583 | 8583 | \pnum |
8584 | 8584 | \errors |
8585 | 8585 | \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} |
8588 | 8588 | is \tcode{true}. |
8589 | 8589 | \end{itemize} |
8590 | 8590 | \end{itemdescr} |
|
8602 | 8602 |
|
8603 | 8603 | \pnum |
8604 | 8604 | \effects |
8605 | | -As if by \tcode{pm->try_lock()}. |
| 8605 | +As if by \tcode{\exposid{pm}->try_lock()}. |
8606 | 8606 |
|
8607 | 8607 | \pnum |
8608 | 8608 | \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()}. |
8611 | 8611 |
|
8612 | 8612 | \pnum |
8613 | 8613 | \returns |
8614 | | -The value returned by \tcode{pm->try_lock()}. |
| 8614 | +The value returned by \tcode{\exposid{pm}->try_lock()}. |
8615 | 8615 |
|
8616 | 8616 | \pnum |
8617 | 8617 | \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 |
8619 | 8619 | is required\iref{thread.req.exception}. |
8620 | 8620 |
|
8621 | 8621 | \pnum |
8622 | 8622 | \errors |
8623 | 8623 | \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} |
8626 | 8626 | is \tcode{true}. |
8627 | 8627 | \end{itemize} |
8628 | 8628 | \end{itemdescr} |
|
8641 | 8641 |
|
8642 | 8642 | \pnum |
8643 | 8643 | \effects |
8644 | | -As if by \tcode{pm->try_lock_until(abs_time)}. |
| 8644 | +As if by \tcode{\exposid{pm}->try_lock_until(abs_time)}. |
8645 | 8645 |
|
8646 | 8646 | \pnum |
8647 | 8647 | \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)}. |
8650 | 8650 |
|
8651 | 8651 | \pnum |
8652 | 8652 | \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)}. |
8654 | 8654 |
|
8655 | 8655 | \pnum |
8656 | 8656 | \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 |
8658 | 8658 | exception is required\iref{thread.req.exception}. |
8659 | 8659 |
|
8660 | 8660 | \pnum |
8661 | 8661 | \errors |
8662 | 8662 | \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 |
8665 | 8665 | \tcode{true}. |
8666 | 8666 | \end{itemize} |
8667 | 8667 | \end{itemdescr} |
|
8679 | 8679 |
|
8680 | 8680 | \pnum |
8681 | 8681 | \effects |
8682 | | -As if by \tcode{pm->try_lock_for(rel_time)}. |
| 8682 | +As if by \tcode{\exposid{pm}->try_lock_for(rel_time)}. |
8683 | 8683 |
|
8684 | 8684 | \pnum |
8685 | 8685 | \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)}. |
8687 | 8687 |
|
8688 | 8688 | \pnum |
8689 | 8689 | \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)}. |
8691 | 8691 |
|
8692 | 8692 | \pnum |
8693 | 8693 | \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 |
8695 | 8695 | exception is required\iref{thread.req.exception}. |
8696 | 8696 |
|
8697 | 8697 | \pnum |
8698 | 8698 | \errors |
8699 | 8699 | \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 |
8702 | 8702 | \tcode{true}. |
8703 | 8703 | \end{itemize} |
8704 | 8704 | \end{itemdescr} |
|
8711 | 8711 | \begin{itemdescr} |
8712 | 8712 | \pnum |
8713 | 8713 | \effects |
8714 | | -As if by \tcode{pm->unlock()}. |
| 8714 | +As if by \tcode{\exposid{pm}->unlock()}. |
8715 | 8715 |
|
8716 | 8716 | \pnum |
8717 | 8717 | \ensures |
8718 | | -\tcode{owns == false}. |
| 8718 | +\tcode{\exposid{owns} == false}. |
8719 | 8719 |
|
8720 | 8720 | \pnum |
8721 | 8721 | \throws |
|
8725 | 8725 | \pnum |
8726 | 8726 | \errors |
8727 | 8727 | \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}. |
8729 | 8729 | \end{itemize} |
8730 | 8730 | \end{itemdescr} |
8731 | 8731 |
|
|
8750 | 8750 | \begin{itemdescr} |
8751 | 8751 | \pnum |
8752 | 8752 | \ensures |
8753 | | -\tcode{pm == 0} and \tcode{owns == false}. |
| 8753 | +\tcode{\exposid{pm} == 0} and \tcode{\exposid{owns} == false}. |
8754 | 8754 |
|
8755 | 8755 | \pnum |
8756 | 8756 | \returns |
8757 | | -The previous value of \tcode{pm}. |
| 8757 | +The previous value of \exposid{pm}. |
8758 | 8758 | \end{itemdescr} |
8759 | 8759 |
|
8760 | 8760 | \indexlibrarymember{swap}{unique_lock}% |
|
8779 | 8779 | \begin{itemdescr} |
8780 | 8780 | \pnum |
8781 | 8781 | \returns |
8782 | | -\tcode{owns}. |
| 8782 | +\exposid{owns}. |
8783 | 8783 | \end{itemdescr} |
8784 | 8784 |
|
8785 | 8785 | \indexlibrarymember{operator bool}{unique_lock}% |
|
8801 | 8801 | \begin{itemdescr} |
8802 | 8802 | \pnum |
8803 | 8803 | \returns |
8804 | | -\tcode{pm}. |
| 8804 | +\exposid{pm}. |
8805 | 8805 | \end{itemdescr} |
8806 | 8806 |
|
8807 | 8807 | \rSec3[thread.lock.shared]{Class template \tcode{shared_lock}} |
|
0 commit comments