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