|
8400 | 8400 | mutex_type* mutex() const noexcept; |
8401 | 8401 |
|
8402 | 8402 | private: |
8403 | | - mutex_type* pm; // \expos |
8404 | | - bool owns; // \expos |
| 8403 | + mutex_type* @\exposid{pm}@; // \expos |
| 8404 | + bool @\exposid{owns}@; // \expos |
8405 | 8405 | }; |
8406 | 8406 | } |
8407 | 8407 | \end{codeblock} |
|
8412 | 8412 | construction or after construction, and may be transferred, after |
8413 | 8413 | acquisition, to another \tcode{unique_lock} object. Objects of type \tcode{unique_lock} are not |
8414 | 8414 | copyable but are movable. The behavior of a program is undefined if the contained pointer |
8415 | | -\tcode{pm} is not null and the lockable object pointed |
8416 | | -to by \tcode{pm} does not exist for the entire remaining |
| 8415 | +\exposid{pm} is not null and the lockable object pointed |
| 8416 | +to by \exposid{pm} does not exist for the entire remaining |
8417 | 8417 | lifetime\iref{basic.life} of the \tcode{unique_lock} object. The supplied |
8418 | 8418 | \tcode{Mutex} type shall meet the \oldconcept{BasicLockable} |
8419 | 8419 | requirements\iref{thread.req.lockable.basic}. |
|
8438 | 8438 | \begin{itemdescr} |
8439 | 8439 | \pnum |
8440 | 8440 | \ensures |
8441 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 8441 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
8442 | 8442 | \end{itemdescr} |
8443 | 8443 |
|
8444 | 8444 | \indexlibraryctor{unique_lock}% |
|
8453 | 8453 |
|
8454 | 8454 | \pnum |
8455 | 8455 | \ensures |
8456 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8456 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8457 | 8457 | \end{itemdescr} |
8458 | 8458 |
|
8459 | 8459 | \indexlibraryctor{unique_lock}% |
|
8464 | 8464 | \begin{itemdescr} |
8465 | 8465 | \pnum |
8466 | 8466 | \ensures |
8467 | | -\tcode{pm == addressof(m)} and \tcode{owns == false}. |
| 8467 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == false}. |
8468 | 8468 | \end{itemdescr} |
8469 | 8469 |
|
8470 | 8470 | \indexlibraryctor{unique_lock}% |
|
8484 | 8484 |
|
8485 | 8485 | \pnum |
8486 | 8486 | \ensures |
8487 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8487 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{o\exposid{owns}wns == res}, |
8488 | 8488 | where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}. |
8489 | 8489 | \end{itemdescr} |
8490 | 8490 |
|
|
8500 | 8500 |
|
8501 | 8501 | \pnum |
8502 | 8502 | \ensures |
8503 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8503 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8504 | 8504 |
|
8505 | 8505 | \pnum |
8506 | 8506 | \throws |
|
8525 | 8525 |
|
8526 | 8526 | \pnum |
8527 | 8527 | \ensures |
8528 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8528 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, |
8529 | 8529 | where \tcode{res} is |
8530 | 8530 | the value returned by the call to \tcode{m.try_lock_until(abs_time)}. |
8531 | 8531 | \end{itemdescr} |
|
8547 | 8547 |
|
8548 | 8548 | \pnum |
8549 | 8549 | \ensures |
8550 | | -\tcode{pm == addressof(m)} and \tcode{owns == res}, |
| 8550 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res}, |
8551 | 8551 | where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}. |
8552 | 8552 | \end{itemdescr} |
8553 | 8553 |
|
|
8559 | 8559 | \begin{itemdescr} |
8560 | 8560 | \pnum |
8561 | 8561 | \ensures |
8562 | | -\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}. |
| 8562 | +\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}. |
8563 | 8563 | \end{itemdescr} |
8564 | 8564 |
|
8565 | 8565 | \indexlibrarymember{operator=}{unique_lock}% |
|
8585 | 8585 | \begin{itemdescr} |
8586 | 8586 | \pnum |
8587 | 8587 | \effects |
8588 | | -If \tcode{owns} calls \tcode{pm->unlock()}. |
| 8588 | +If \exposid{owns} calls \tcode{\exposid{pm}->unlock()}. |
8589 | 8589 | \end{itemdescr} |
8590 | 8590 |
|
8591 | 8591 | \rSec4[thread.lock.unique.locking]{Locking} |
|
8598 | 8598 | \begin{itemdescr} |
8599 | 8599 | \pnum |
8600 | 8600 | \effects |
8601 | | -As if by \tcode{pm->lock()}. |
| 8601 | +As if by \tcode{\exposid{pm}->lock()}. |
8602 | 8602 |
|
8603 | 8603 | \pnum |
8604 | 8604 | \ensures |
8605 | | -\tcode{owns == true}. |
| 8605 | +\tcode{\exposid{owns} == true}. |
8606 | 8606 |
|
8607 | 8607 | \pnum |
8608 | 8608 | \throws |
8609 | | -Any exception thrown by \tcode{pm->lock()}. \tcode{system_error} when an exception |
| 8609 | +Any exception thrown by \tcode{\exposid{pm}->lock()}. \tcode{system_error} when an exception |
8610 | 8610 | is required\iref{thread.req.exception}. |
8611 | 8611 |
|
8612 | 8612 | \pnum |
8613 | 8613 | \errors |
8614 | 8614 | \begin{itemize} |
8615 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
8616 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} |
| 8615 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 8616 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} |
8617 | 8617 | is \tcode{true}. |
8618 | 8618 | \end{itemize} |
8619 | 8619 | \end{itemdescr} |
|
8631 | 8631 |
|
8632 | 8632 | \pnum |
8633 | 8633 | \effects |
8634 | | -As if by \tcode{pm->try_lock()}. |
| 8634 | +As if by \tcode{\exposid{pm}->try_lock()}. |
8635 | 8635 |
|
8636 | 8636 | \pnum |
8637 | 8637 | \ensures |
8638 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
8639 | | -\tcode{pm->try_lock()}. |
| 8638 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 8639 | +\tcode{\exposid{pm}->try_lock()}. |
8640 | 8640 |
|
8641 | 8641 | \pnum |
8642 | 8642 | \returns |
8643 | | -The value returned by \tcode{pm->try_lock()}. |
| 8643 | +The value returned by \tcode{\exposid{pm}->try_lock()}. |
8644 | 8644 |
|
8645 | 8645 | \pnum |
8646 | 8646 | \throws |
8647 | | -Any exception thrown by \tcode{pm->try_lock()}. \tcode{system_error} when an exception |
| 8647 | +Any exception thrown by \tcode{\exposid{pm}->try_lock()}. \tcode{system_error} when an exception |
8648 | 8648 | is required\iref{thread.req.exception}. |
8649 | 8649 |
|
8650 | 8650 | \pnum |
8651 | 8651 | \errors |
8652 | 8652 | \begin{itemize} |
8653 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
8654 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} |
| 8653 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 8654 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} |
8655 | 8655 | is \tcode{true}. |
8656 | 8656 | \end{itemize} |
8657 | 8657 | \end{itemdescr} |
|
8670 | 8670 |
|
8671 | 8671 | \pnum |
8672 | 8672 | \effects |
8673 | | -As if by \tcode{pm->try_lock_until(abs_time)}. |
| 8673 | +As if by \tcode{\exposid{pm}->try_lock_until(abs_time)}. |
8674 | 8674 |
|
8675 | 8675 | \pnum |
8676 | 8676 | \ensures |
8677 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
8678 | | -\tcode{pm->try_lock_until(abs_time)}. |
| 8677 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 8678 | +\tcode{\exposid{pm}->try_lock_until(abs_time)}. |
8679 | 8679 |
|
8680 | 8680 | \pnum |
8681 | 8681 | \returns |
8682 | | -The value returned by \tcode{pm->try_lock_until(abs_time)}. |
| 8682 | +The value returned by \tcode{\exposid{pm}->try_lock_until(abs_time)}. |
8683 | 8683 |
|
8684 | 8684 | \pnum |
8685 | 8685 | \throws |
8686 | | -Any exception thrown by \tcode{pm->try_lock_until(abstime)}. \tcode{system_error} when an |
| 8686 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_until(abstime)}. \tcode{system_error} when an |
8687 | 8687 | exception is required\iref{thread.req.exception}. |
8688 | 8688 |
|
8689 | 8689 | \pnum |
8690 | 8690 | \errors |
8691 | 8691 | \begin{itemize} |
8692 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
8693 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 8692 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 8693 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
8694 | 8694 | \tcode{true}. |
8695 | 8695 | \end{itemize} |
8696 | 8696 | \end{itemdescr} |
|
8708 | 8708 |
|
8709 | 8709 | \pnum |
8710 | 8710 | \effects |
8711 | | -As if by \tcode{pm->try_lock_for(rel_time)}. |
| 8711 | +As if by \tcode{\exposid{pm}->try_lock_for(rel_time)}. |
8712 | 8712 |
|
8713 | 8713 | \pnum |
8714 | 8714 | \ensures |
8715 | | -\tcode{owns == res}, where \tcode{res} is the value returned by \tcode{pm->try_lock_for(rel_time)}. |
| 8715 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}. |
8716 | 8716 |
|
8717 | 8717 | \pnum |
8718 | 8718 | \returns |
8719 | | -The value returned by \tcode{pm->try_lock_for(rel_time)}. |
| 8719 | +The value returned by \tcode{\exposid{pm}->try_lock_for(rel_time)}. |
8720 | 8720 |
|
8721 | 8721 | \pnum |
8722 | 8722 | \throws |
8723 | | -Any exception thrown by \tcode{pm->try_lock_for(rel_time)}. \tcode{system_error} when an |
| 8723 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_for(rel_time)}. \tcode{system_error} when an |
8724 | 8724 | exception is required\iref{thread.req.exception}. |
8725 | 8725 |
|
8726 | 8726 | \pnum |
8727 | 8727 | \errors |
8728 | 8728 | \begin{itemize} |
8729 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
8730 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 8729 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 8730 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
8731 | 8731 | \tcode{true}. |
8732 | 8732 | \end{itemize} |
8733 | 8733 | \end{itemdescr} |
|
8740 | 8740 | \begin{itemdescr} |
8741 | 8741 | \pnum |
8742 | 8742 | \effects |
8743 | | -As if by \tcode{pm->unlock()}. |
| 8743 | +As if by \tcode{\exposid{pm}->unlock()}. |
8744 | 8744 |
|
8745 | 8745 | \pnum |
8746 | 8746 | \ensures |
8747 | | -\tcode{owns == false}. |
| 8747 | +\tcode{\exposid{owns} == false}. |
8748 | 8748 |
|
8749 | 8749 | \pnum |
8750 | 8750 | \throws |
|
8754 | 8754 | \pnum |
8755 | 8755 | \errors |
8756 | 8756 | \begin{itemize} |
8757 | | -\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is \tcode{false}. |
| 8757 | +\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is \tcode{false}. |
8758 | 8758 | \end{itemize} |
8759 | 8759 | \end{itemdescr} |
8760 | 8760 |
|
|
8779 | 8779 | \begin{itemdescr} |
8780 | 8780 | \pnum |
8781 | 8781 | \ensures |
8782 | | -\tcode{pm == 0} and \tcode{owns == false}. |
| 8782 | +\tcode{\exposid{pm} == 0} and \tcode{\exposid{owns} == false}. |
8783 | 8783 |
|
8784 | 8784 | \pnum |
8785 | 8785 | \returns |
8786 | | -The previous value of \tcode{pm}. |
| 8786 | +The previous value of \exposid{pm}. |
8787 | 8787 | \end{itemdescr} |
8788 | 8788 |
|
8789 | 8789 | \indexlibrarymember{swap}{unique_lock}% |
|
8808 | 8808 | \begin{itemdescr} |
8809 | 8809 | \pnum |
8810 | 8810 | \returns |
8811 | | -\tcode{owns}. |
| 8811 | +\exposid{owns}. |
8812 | 8812 | \end{itemdescr} |
8813 | 8813 |
|
8814 | 8814 | \indexlibrarymember{operator bool}{unique_lock}% |
|
8830 | 8830 | \begin{itemdescr} |
8831 | 8831 | \pnum |
8832 | 8832 | \returns |
8833 | | -\tcode{pm}. |
| 8833 | +\exposid{pm}. |
8834 | 8834 | \end{itemdescr} |
8835 | 8835 |
|
8836 | 8836 | \rSec3[thread.lock.shared]{Class template \tcode{shared_lock}} |
|
0 commit comments