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