|
8853 | 8853 | mutex_type* mutex() const noexcept; |
8854 | 8854 |
|
8855 | 8855 | private: |
8856 | | - mutex_type* pm; // \expos |
8857 | | - bool owns; // \expos |
| 8856 | + mutex_type* @\exposid{pm}@; // \expos |
| 8857 | + bool @\exposid{owns}@; // \expos |
8858 | 8858 | }; |
8859 | 8859 | } |
8860 | 8860 | \end{codeblock} |
|
8865 | 8865 | acquired at construction or after construction, and may be transferred, after |
8866 | 8866 | acquisition, to another \tcode{shared_lock} object. Objects of type |
8867 | 8867 | \tcode{shared_lock} are not copyable but are movable. The behavior of a program |
8868 | | -is undefined if the contained pointer \tcode{pm} is not null and the lockable |
8869 | | -object pointed to by \tcode{pm} does not exist for the entire remaining |
| 8868 | +is undefined if the contained pointer \exposid{pm} is not null and the lockable |
| 8869 | +object pointed to by \exposid{pm} does not exist for the entire remaining |
8870 | 8870 | lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied |
8871 | 8871 | \tcode{Mutex} type shall meet the \oldconcept{SharedLockable} |
8872 | 8872 | requirements\iref{thread.req.lockable.shared}. |
|
8891 | 8891 | \begin{itemdescr} |
8892 | 8892 | \pnum |
8893 | 8893 | \ensures |
8894 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 8894 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
8895 | 8895 | \end{itemdescr} |
8896 | 8896 |
|
8897 | 8897 | \indexlibraryctor{shared_lock}% |
|
8906 | 8906 |
|
8907 | 8907 | \pnum |
8908 | 8908 | \ensures |
8909 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8909 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8910 | 8910 | \end{itemdescr} |
8911 | 8911 |
|
8912 | 8912 | \indexlibraryctor{shared_lock}% |
|
8917 | 8917 | \begin{itemdescr} |
8918 | 8918 | \pnum |
8919 | 8919 | \ensures |
8920 | | -\tcode{pm == addressof(m)} and \tcode{owns == false}. |
| 8920 | +\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}. |
8921 | 8921 | \end{itemdescr} |
8922 | 8922 |
|
8923 | 8923 | \indexlibraryctor{shared_lock}% |
|
8932 | 8932 |
|
8933 | 8933 | \pnum |
8934 | 8934 | \ensures |
8935 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 8935 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
8936 | 8936 | where \tcode{res} is the |
8937 | 8937 | value returned by the call to \tcode{m.try_lock_shared()}. |
8938 | 8938 | \end{itemdescr} |
|
8949 | 8949 |
|
8950 | 8950 | \pnum |
8951 | 8951 | \ensures |
8952 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8952 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8953 | 8953 | \end{itemdescr} |
8954 | 8954 |
|
8955 | 8955 | \indexlibraryctor{shared_lock}% |
|
8971 | 8971 |
|
8972 | 8972 | \pnum |
8973 | 8973 | \ensures |
8974 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 8974 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
8975 | 8975 | where \tcode{res} |
8976 | 8976 | is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}. |
8977 | 8977 | \end{itemdescr} |
|
8995 | 8995 |
|
8996 | 8996 | \pnum |
8997 | 8997 | \ensures |
8998 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 8998 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
8999 | 8999 | where \tcode{res} is |
9000 | 9000 | the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}. |
9001 | 9001 | \end{itemdescr} |
|
9008 | 9008 | \begin{itemdescr} |
9009 | 9009 | \pnum |
9010 | 9010 | \effects |
9011 | | -If \tcode{owns} calls \tcode{pm->unlock_shared()}. |
| 9011 | +If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}. |
9012 | 9012 | \end{itemdescr} |
9013 | 9013 |
|
9014 | 9014 | \indexlibraryctor{shared_lock}% |
|
9019 | 9019 | \begin{itemdescr} |
9020 | 9020 | \pnum |
9021 | 9021 | \ensures |
9022 | | -\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where |
| 9022 | +\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where |
9023 | 9023 | \tcode{sl_p} is the state of \tcode{sl} just prior to this construction), |
9024 | | -\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}. |
| 9024 | +\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}. |
9025 | 9025 | \end{itemdescr} |
9026 | 9026 |
|
9027 | 9027 | \indexlibrarymember{operator=}{shared_lock}% |
|
9049 | 9049 | \begin{itemdescr} |
9050 | 9050 | \pnum |
9051 | 9051 | \effects |
9052 | | -As if by \tcode{pm->lock_shared()}. |
| 9052 | +As if by \tcode{\exposid{pm}->lock_shared()}. |
9053 | 9053 |
|
9054 | 9054 | \pnum |
9055 | 9055 | \ensures |
9056 | | -\tcode{owns == true}. |
| 9056 | +\tcode{\exposid{owns} == true}. |
9057 | 9057 |
|
9058 | 9058 | \pnum |
9059 | 9059 | \throws |
9060 | | -Any exception thrown by \tcode{pm->lock_shared()}. |
| 9060 | +Any exception thrown by \tcode{\exposid{pm}->lock_shared()}. |
9061 | 9061 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9062 | 9062 |
|
9063 | 9063 | \pnum |
9064 | 9064 | \errors |
9065 | 9065 | \begin{itemize} |
9066 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9067 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9066 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9067 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9068 | 9068 | \tcode{true}. |
9069 | 9069 | \end{itemize} |
9070 | 9070 | \end{itemdescr} |
|
9077 | 9077 | \begin{itemdescr} |
9078 | 9078 | \pnum |
9079 | 9079 | \effects |
9080 | | -As if by \tcode{pm->try_lock_shared()}. |
| 9080 | +As if by \tcode{\exposid{pm}->try_lock_shared()}. |
9081 | 9081 |
|
9082 | 9082 | \pnum |
9083 | 9083 | \ensures |
9084 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
9085 | | -the call to \tcode{pm->try_lock_shared()}. |
| 9084 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 9085 | +the call to \tcode{\exposid{pm}->try_lock_shared()}. |
9086 | 9086 |
|
9087 | 9087 | \pnum |
9088 | 9088 | \returns |
9089 | | -The value returned by the call to \tcode{pm->try_lock_shared()}. |
| 9089 | +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}. |
9090 | 9090 |
|
9091 | 9091 | \pnum |
9092 | 9092 | \throws |
9093 | | -Any exception thrown by \tcode{pm->try_lock_shared()}. |
| 9093 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared()}. |
9094 | 9094 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9095 | 9095 |
|
9096 | 9096 | \pnum |
9097 | 9097 | \errors |
9098 | 9098 | \begin{itemize} |
9099 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9100 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9099 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9100 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9101 | 9101 | \tcode{true}. |
9102 | 9102 | \end{itemize} |
9103 | 9103 | \end{itemdescr} |
|
9116 | 9116 |
|
9117 | 9117 | \pnum |
9118 | 9118 | \effects |
9119 | | -As if by \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9119 | +As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9120 | 9120 |
|
9121 | 9121 | \pnum |
9122 | 9122 | \ensures |
9123 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
9124 | | -the call to \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9123 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 9124 | +the call to \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9125 | 9125 |
|
9126 | 9126 | \pnum |
9127 | 9127 | \returns |
9128 | 9128 | The value returned by the call to |
9129 | | -\tcode{pm->try_lock_shared_until(abs_time)}. |
| 9129 | +\tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9130 | 9130 |
|
9131 | 9131 | \pnum |
9132 | 9132 | \throws |
9133 | | -Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9133 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9134 | 9134 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9135 | 9135 |
|
9136 | 9136 | \pnum |
9137 | 9137 | \errors |
9138 | 9138 | \begin{itemize} |
9139 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9140 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9139 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9140 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9141 | 9141 | \tcode{true}. |
9142 | 9142 | \end{itemize} |
9143 | 9143 | \end{itemdescr} |
|
9156 | 9156 |
|
9157 | 9157 | \pnum |
9158 | 9158 | \effects |
9159 | | -As if by \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9159 | +As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9160 | 9160 |
|
9161 | 9161 | \pnum |
9162 | 9162 | \ensures |
9163 | | -\tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9163 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9164 | 9164 |
|
9165 | 9165 | \pnum |
9166 | 9166 | \returns |
9167 | | -The value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9167 | +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9168 | 9168 |
|
9169 | 9169 | \pnum |
9170 | 9170 | \throws |
9171 | | -Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
| 9171 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9172 | 9172 |
|
9173 | 9173 | \pnum |
9174 | 9174 | \errors |
9175 | 9175 | \begin{itemize} |
9176 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9177 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9176 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9177 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9178 | 9178 | \tcode{true}. |
9179 | 9179 | \end{itemize} |
9180 | 9180 | \end{itemdescr} |
|
9187 | 9187 | \begin{itemdescr} |
9188 | 9188 | \pnum |
9189 | 9189 | \effects |
9190 | | -As if by \tcode{pm->unlock_shared()}. |
| 9190 | +As if by \tcode{\exposid{pm}->unlock_shared()}. |
9191 | 9191 |
|
9192 | 9192 | \pnum |
9193 | 9193 | \ensures |
9194 | | -\tcode{owns == false}. |
| 9194 | +\tcode{\exposid{owns} == false}. |
9195 | 9195 |
|
9196 | 9196 | \pnum |
9197 | 9197 | \throws |
|
9200 | 9200 | \pnum |
9201 | 9201 | \errors |
9202 | 9202 | \begin{itemize} |
9203 | | -\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is |
| 9203 | +\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is |
9204 | 9204 | \tcode{false}. |
9205 | 9205 | \end{itemize} |
9206 | 9206 | \end{itemdescr} |
|
9226 | 9226 | \begin{itemdescr} |
9227 | 9227 | \pnum |
9228 | 9228 | \ensures |
9229 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 9229 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
9230 | 9230 |
|
9231 | 9231 | \pnum |
9232 | 9232 | \returns |
9233 | | -The previous value of \tcode{pm}. |
| 9233 | +The previous value of \exposid{pm}. |
9234 | 9234 | \end{itemdescr} |
9235 | 9235 |
|
9236 | 9236 | \indexlibrarymember{swap}{shared_lock}% |
|
9255 | 9255 | \begin{itemdescr} |
9256 | 9256 | \pnum |
9257 | 9257 | \returns |
9258 | | -\tcode{owns}. |
| 9258 | +\exposid{owns}. |
9259 | 9259 | \end{itemdescr} |
9260 | 9260 |
|
9261 | 9261 | \indexlibrarymember{operator bool}{shared_lock}% |
|
9266 | 9266 | \begin{itemdescr} |
9267 | 9267 | \pnum |
9268 | 9268 | \returns |
9269 | | -\tcode{owns}. |
| 9269 | +\exposid{owns}. |
9270 | 9270 | \end{itemdescr} |
9271 | 9271 |
|
9272 | 9272 | \indexlibrarymember{mutex}{shared_lock}% |
|
9277 | 9277 | \begin{itemdescr} |
9278 | 9278 | \pnum |
9279 | 9279 | \returns |
9280 | | -\tcode{pm}. |
| 9280 | +\exposid{pm}. |
9281 | 9281 | \end{itemdescr} |
9282 | 9282 |
|
9283 | 9283 | \rSec2[thread.lock.algorithm]{Generic locking algorithms} |
|
0 commit comments