|
8882 | 8882 | mutex_type* mutex() const noexcept; |
8883 | 8883 |
|
8884 | 8884 | private: |
8885 | | - mutex_type* pm; // \expos |
8886 | | - bool owns; // \expos |
| 8885 | + mutex_type* @\exposid{pm}@; // \expos |
| 8886 | + bool @\exposid{owns}@; // \expos |
8887 | 8887 | }; |
8888 | 8888 | } |
8889 | 8889 | \end{codeblock} |
|
8894 | 8894 | acquired at construction or after construction, and may be transferred, after |
8895 | 8895 | acquisition, to another \tcode{shared_lock} object. Objects of type |
8896 | 8896 | \tcode{shared_lock} are not copyable but are movable. The behavior of a program |
8897 | | -is undefined if the contained pointer \tcode{pm} is not null and the lockable |
8898 | | -object pointed to by \tcode{pm} does not exist for the entire remaining |
| 8897 | +is undefined if the contained pointer \exposid{pm} is not null and the lockable |
| 8898 | +object pointed to by \exposid{pm} does not exist for the entire remaining |
8899 | 8899 | lifetime\iref{basic.life} of the \tcode{shared_lock} object. The supplied |
8900 | 8900 | \tcode{Mutex} type shall meet the \oldconcept{SharedLockable} |
8901 | 8901 | requirements\iref{thread.req.lockable.shared}. |
|
8920 | 8920 | \begin{itemdescr} |
8921 | 8921 | \pnum |
8922 | 8922 | \ensures |
8923 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 8923 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
8924 | 8924 | \end{itemdescr} |
8925 | 8925 |
|
8926 | 8926 | \indexlibraryctor{shared_lock}% |
|
8935 | 8935 |
|
8936 | 8936 | \pnum |
8937 | 8937 | \ensures |
8938 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8938 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8939 | 8939 | \end{itemdescr} |
8940 | 8940 |
|
8941 | 8941 | \indexlibraryctor{shared_lock}% |
|
8946 | 8946 | \begin{itemdescr} |
8947 | 8947 | \pnum |
8948 | 8948 | \ensures |
8949 | | -\tcode{pm == addressof(m)} and \tcode{owns == false}. |
| 8949 | +\tcode{pm == addressof(m)} and \tcode{\exposid{owns} == false}. |
8950 | 8950 | \end{itemdescr} |
8951 | 8951 |
|
8952 | 8952 | \indexlibraryctor{shared_lock}% |
|
8961 | 8961 |
|
8962 | 8962 | \pnum |
8963 | 8963 | \ensures |
8964 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 8964 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
8965 | 8965 | where \tcode{res} is the |
8966 | 8966 | value returned by the call to \tcode{m.try_lock_shared()}. |
8967 | 8967 | \end{itemdescr} |
|
8978 | 8978 |
|
8979 | 8979 | \pnum |
8980 | 8980 | \ensures |
8981 | | -\tcode{pm == addressof(m)} and \tcode{owns == true}. |
| 8981 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == true}. |
8982 | 8982 | \end{itemdescr} |
8983 | 8983 |
|
8984 | 8984 | \indexlibraryctor{shared_lock}% |
|
9000 | 9000 |
|
9001 | 9001 | \pnum |
9002 | 9002 | \ensures |
9003 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 9003 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
9004 | 9004 | where \tcode{res} |
9005 | 9005 | is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}. |
9006 | 9006 | \end{itemdescr} |
|
9024 | 9024 |
|
9025 | 9025 | \pnum |
9026 | 9026 | \ensures |
9027 | | -\tcode{pm == addressof(m)} and \tcode{owns == res} |
| 9027 | +\tcode{\exposid{pm} == addressof(m)} and \tcode{\exposid{owns} == res} |
9028 | 9028 | where \tcode{res} is |
9029 | 9029 | the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}. |
9030 | 9030 | \end{itemdescr} |
|
9037 | 9037 | \begin{itemdescr} |
9038 | 9038 | \pnum |
9039 | 9039 | \effects |
9040 | | -If \tcode{owns} calls \tcode{pm->unlock_shared()}. |
| 9040 | +If \exposid{owns} calls \tcode{\exposid{pm}->unlock_shared()}. |
9041 | 9041 | \end{itemdescr} |
9042 | 9042 |
|
9043 | 9043 | \indexlibraryctor{shared_lock}% |
|
9048 | 9048 | \begin{itemdescr} |
9049 | 9049 | \pnum |
9050 | 9050 | \ensures |
9051 | | -\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where |
| 9051 | +\tcode{\exposid{pm} == sl_p.\exposid{pm}} and \tcode{\exposid{owns} == sl_p.\exposid{owns}} (where |
9052 | 9052 | \tcode{sl_p} is the state of \tcode{sl} just prior to this construction), |
9053 | | -\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}. |
| 9053 | +\tcode{sl.\exposid{pm} == nullptr} and \tcode{sl.\exposid{owns} == false}. |
9054 | 9054 | \end{itemdescr} |
9055 | 9055 |
|
9056 | 9056 | \indexlibrarymember{operator=}{shared_lock}% |
|
9078 | 9078 | \begin{itemdescr} |
9079 | 9079 | \pnum |
9080 | 9080 | \effects |
9081 | | -As if by \tcode{pm->lock_shared()}. |
| 9081 | +As if by \tcode{\exposid{pm}->lock_shared()}. |
9082 | 9082 |
|
9083 | 9083 | \pnum |
9084 | 9084 | \ensures |
9085 | | -\tcode{owns == true}. |
| 9085 | +\tcode{\exposid{owns} == true}. |
9086 | 9086 |
|
9087 | 9087 | \pnum |
9088 | 9088 | \throws |
9089 | | -Any exception thrown by \tcode{pm->lock_shared()}. |
| 9089 | +Any exception thrown by \tcode{\exposid{pm}->lock_shared()}. |
9090 | 9090 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9091 | 9091 |
|
9092 | 9092 | \pnum |
9093 | 9093 | \errors |
9094 | 9094 | \begin{itemize} |
9095 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9096 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9095 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9096 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9097 | 9097 | \tcode{true}. |
9098 | 9098 | \end{itemize} |
9099 | 9099 | \end{itemdescr} |
|
9106 | 9106 | \begin{itemdescr} |
9107 | 9107 | \pnum |
9108 | 9108 | \effects |
9109 | | -As if by \tcode{pm->try_lock_shared()}. |
| 9109 | +As if by \tcode{\exposid{pm}->try_lock_shared()}. |
9110 | 9110 |
|
9111 | 9111 | \pnum |
9112 | 9112 | \ensures |
9113 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
9114 | | -the call to \tcode{pm->try_lock_shared()}. |
| 9113 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 9114 | +the call to \tcode{\exposid{pm}->try_lock_shared()}. |
9115 | 9115 |
|
9116 | 9116 | \pnum |
9117 | 9117 | \returns |
9118 | | -The value returned by the call to \tcode{pm->try_lock_shared()}. |
| 9118 | +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared()}. |
9119 | 9119 |
|
9120 | 9120 | \pnum |
9121 | 9121 | \throws |
9122 | | -Any exception thrown by \tcode{pm->try_lock_shared()}. |
| 9122 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared()}. |
9123 | 9123 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9124 | 9124 |
|
9125 | 9125 | \pnum |
9126 | 9126 | \errors |
9127 | 9127 | \begin{itemize} |
9128 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9129 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9128 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9129 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9130 | 9130 | \tcode{true}. |
9131 | 9131 | \end{itemize} |
9132 | 9132 | \end{itemdescr} |
|
9145 | 9145 |
|
9146 | 9146 | \pnum |
9147 | 9147 | \effects |
9148 | | -As if by \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9148 | +As if by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9149 | 9149 |
|
9150 | 9150 | \pnum |
9151 | 9151 | \ensures |
9152 | | -\tcode{owns == res}, where \tcode{res} is the value returned by |
9153 | | -the call to \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9152 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by |
| 9153 | +the call to \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9154 | 9154 |
|
9155 | 9155 | \pnum |
9156 | 9156 | \returns |
9157 | 9157 | The value returned by the call to |
9158 | | -\tcode{pm->try_lock_shared_until(abs_time)}. |
| 9158 | +\tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9159 | 9159 |
|
9160 | 9160 | \pnum |
9161 | 9161 | \throws |
9162 | | -Any exception thrown by \tcode{pm->try_lock_shared_until(abs_time)}. |
| 9162 | +Any exception thrown by \tcode{\exposid{pm}->try_lock_shared_until(abs_time)}. |
9163 | 9163 | \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
9164 | 9164 |
|
9165 | 9165 | \pnum |
9166 | 9166 | \errors |
9167 | 9167 | \begin{itemize} |
9168 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9169 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9168 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9169 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9170 | 9170 | \tcode{true}. |
9171 | 9171 | \end{itemize} |
9172 | 9172 | \end{itemdescr} |
|
9185 | 9185 |
|
9186 | 9186 | \pnum |
9187 | 9187 | \effects |
9188 | | -As if by \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9188 | +As if by \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9189 | 9189 |
|
9190 | 9190 | \pnum |
9191 | 9191 | \ensures |
9192 | | -\tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9192 | +\tcode{\exposid{owns} == res}, where \tcode{res} is the value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9193 | 9193 |
|
9194 | 9194 | \pnum |
9195 | 9195 | \returns |
9196 | | -The value returned by the call to \tcode{pm->try_lock_shared_for(rel_time)}. |
| 9196 | +The value returned by the call to \tcode{\exposid{pm}->try_lock_shared_for(rel_time)}. |
9197 | 9197 |
|
9198 | 9198 | \pnum |
9199 | 9199 | \throws |
9200 | | -Any exception thrown by \tcode{pm->try_lock_shared_for(rel_time)}. \tcode{system_error} when an exception is required\iref{thread.req.exception}. |
| 9200 | +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}. |
9201 | 9201 |
|
9202 | 9202 | \pnum |
9203 | 9203 | \errors |
9204 | 9204 | \begin{itemize} |
9205 | | -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. |
9206 | | -\item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is |
| 9205 | +\item \tcode{operation_not_permitted} --- if \exposid{pm} is \keyword{nullptr}. |
| 9206 | +\item \tcode{resource_deadlock_would_occur} --- if on entry \exposid{owns} is |
9207 | 9207 | \tcode{true}. |
9208 | 9208 | \end{itemize} |
9209 | 9209 | \end{itemdescr} |
|
9216 | 9216 | \begin{itemdescr} |
9217 | 9217 | \pnum |
9218 | 9218 | \effects |
9219 | | -As if by \tcode{pm->unlock_shared()}. |
| 9219 | +As if by \tcode{\exposid{pm}->unlock_shared()}. |
9220 | 9220 |
|
9221 | 9221 | \pnum |
9222 | 9222 | \ensures |
9223 | | -\tcode{owns == false}. |
| 9223 | +\tcode{\exposid{owns} == false}. |
9224 | 9224 |
|
9225 | 9225 | \pnum |
9226 | 9226 | \throws |
|
9229 | 9229 | \pnum |
9230 | 9230 | \errors |
9231 | 9231 | \begin{itemize} |
9232 | | -\item \tcode{operation_not_permitted} --- if on entry \tcode{owns} is |
| 9232 | +\item \tcode{operation_not_permitted} --- if on entry \exposid{owns} is |
9233 | 9233 | \tcode{false}. |
9234 | 9234 | \end{itemize} |
9235 | 9235 | \end{itemdescr} |
|
9255 | 9255 | \begin{itemdescr} |
9256 | 9256 | \pnum |
9257 | 9257 | \ensures |
9258 | | -\tcode{pm == nullptr} and \tcode{owns == false}. |
| 9258 | +\tcode{\exposid{pm} == nullptr} and \tcode{\exposid{owns} == false}. |
9259 | 9259 |
|
9260 | 9260 | \pnum |
9261 | 9261 | \returns |
9262 | | -The previous value of \tcode{pm}. |
| 9262 | +The previous value of \exposid{pm}. |
9263 | 9263 | \end{itemdescr} |
9264 | 9264 |
|
9265 | 9265 | \indexlibrarymember{swap}{shared_lock}% |
|
9284 | 9284 | \begin{itemdescr} |
9285 | 9285 | \pnum |
9286 | 9286 | \returns |
9287 | | -\tcode{owns}. |
| 9287 | +\exposid{owns}. |
9288 | 9288 | \end{itemdescr} |
9289 | 9289 |
|
9290 | 9290 | \indexlibrarymember{operator bool}{shared_lock}% |
|
9295 | 9295 | \begin{itemdescr} |
9296 | 9296 | \pnum |
9297 | 9297 | \returns |
9298 | | -\tcode{owns}. |
| 9298 | +\exposid{owns}. |
9299 | 9299 | \end{itemdescr} |
9300 | 9300 |
|
9301 | 9301 | \indexlibrarymember{mutex}{shared_lock}% |
|
9306 | 9306 | \begin{itemdescr} |
9307 | 9307 | \pnum |
9308 | 9308 | \returns |
9309 | | -\tcode{pm}. |
| 9309 | +\exposid{pm}. |
9310 | 9310 | \end{itemdescr} |
9311 | 9311 |
|
9312 | 9312 | \rSec2[thread.lock.algorithm]{Generic locking algorithms} |
|
0 commit comments