|
11737 | 11737 | bool compare_exchange_strong(shared_ptr<T>& expected, shared_ptr<T> desired,
|
11738 | 11738 | memory_order order = memory_order::seq_cst) noexcept;
|
11739 | 11739 |
|
| 11740 | + void wait(shared_ptr<T> old, memory_order order = memory_order::seq_cst) const noexcept; |
| 11741 | + void notify_one() noexcept; |
| 11742 | + void notify_all() noexcept; |
| 11743 | + |
11740 | 11744 | constexpr atomic() noexcept = default;
|
11741 | 11745 | atomic(shared_ptr<T> desired) noexcept;
|
11742 | 11746 | atomic(const atomic&) = delete;
|
|
11951 | 11955 | shall be replaced by the value \tcode{memory_order::relaxed}.
|
11952 | 11956 | \end{itemdescr}
|
11953 | 11957 |
|
| 11958 | +\indexlibrarymember{wait}{atomic<shared_ptr<T>>}% |
| 11959 | +\begin{itemdecl} |
| 11960 | +void wait(shared_ptr<T> old, memory_order order = memory_order::seq_cst) const noexcept; |
| 11961 | +\end{itemdecl} |
| 11962 | + |
| 11963 | +\begin{itemdescr} |
| 11964 | +\pnum |
| 11965 | +\expects |
| 11966 | +\tcode{order} is |
| 11967 | +neither \tcode{memory_order::release} nor \tcode{memory_order::acq_rel}. |
| 11968 | + |
| 11969 | +\pnum |
| 11970 | +\effects |
| 11971 | +Repeatedly performs the following steps, in order: |
| 11972 | +\begin{itemize} |
| 11973 | +\item |
| 11974 | + Evaluates \tcode{load(order)} and compares it to \tcode{old}. |
| 11975 | +\item |
| 11976 | + If the two are not equivalent, returns. |
| 11977 | +\item |
| 11978 | + Blocks until it |
| 11979 | + is unblocked by an atomic notifying operation or is unblocked spuriously. |
| 11980 | +\end{itemize} |
| 11981 | + |
| 11982 | +\pnum |
| 11983 | +\remarks |
| 11984 | +Two \tcode{shared_ptr} objects are equivalent |
| 11985 | +if they store the same pointer and either share ownership or are both empty. |
| 11986 | +This function is an atomic waiting operation\iref{atomics.wait}. |
| 11987 | +\end{itemdescr} |
| 11988 | + |
| 11989 | +\indexlibrarymember{notify_one}{atomic<shared_ptr<T>>}% |
| 11990 | +\begin{itemdecl} |
| 11991 | +void notify_one() noexcept; |
| 11992 | +\end{itemdecl} |
| 11993 | + |
| 11994 | +\begin{itemdescr} |
| 11995 | +\pnum |
| 11996 | +\effects |
| 11997 | +Unblocks the execution of at least one atomic waiting operation |
| 11998 | +that is eligible to be unblocked\iref{atomics.wait} by this call, |
| 11999 | +if any such atomic waiting operations exist. |
| 12000 | + |
| 12001 | +\pnum |
| 12002 | +\remarks |
| 12003 | +This function is an atomic notifying operation\iref{atomics.wait}. |
| 12004 | +\end{itemdescr} |
| 12005 | + |
| 12006 | +\indexlibrarymember{notify_all}{atomic<shared_ptr<T>>}% |
| 12007 | +\begin{itemdecl} |
| 12008 | +void notify_all() noexcept; |
| 12009 | +\end{itemdecl} |
| 12010 | + |
| 12011 | +\begin{itemdescr} |
| 12012 | +\pnum |
| 12013 | +\effects |
| 12014 | +Unblocks the execution of all atomic waiting operations |
| 12015 | +that are eligible to be unblocked\iref{atomics.wait} by this call. |
| 12016 | + |
| 12017 | +\pnum |
| 12018 | +\remarks |
| 12019 | +This function is an atomic notifying operation\iref{atomics.wait}. |
| 12020 | +\end{itemdescr} |
| 12021 | + |
11954 | 12022 | \rSec3[util.smartptr.atomic.weak]{Atomic specialization for \tcode{weak_ptr}}
|
11955 | 12023 | \indexlibrary{\idxcode{atomic<weak_ptr<T>>}}%
|
11956 | 12024 | \begin{codeblock}
|
|
11977 | 12045 | bool compare_exchange_strong(weak_ptr<T>& expected, weak_ptr<T> desired,
|
11978 | 12046 | memory_order order = memory_order::seq_cst) noexcept;
|
11979 | 12047 |
|
| 12048 | + void wait(weak_ptr<T> old, memory_order order = memory_order::seq_cst) const noexcept; |
| 12049 | + void notify_one() noexcept; |
| 12050 | + void notify_all() noexcept; |
| 12051 | + |
11980 | 12052 | constexpr atomic() noexcept = default;
|
11981 | 12053 | atomic(weak_ptr<T> desired) noexcept;
|
11982 | 12054 | atomic(const atomic&) = delete;
|
|
12189 | 12261 | a value of \tcode{memory_order::release}
|
12190 | 12262 | shall be replaced by the value \tcode{memory_order::relaxed}.
|
12191 | 12263 | \end{itemdescr}
|
| 12264 | + |
| 12265 | +\indexlibrarymember{wait}{atomic<weak_ptr<T>>}% |
| 12266 | +\begin{itemdecl} |
| 12267 | +void wait(weak_ptr<T> old, memory_order order = memory_order::seq_cst) const noexcept; |
| 12268 | +\end{itemdecl} |
| 12269 | + |
| 12270 | +\begin{itemdescr} |
| 12271 | +\pnum |
| 12272 | +\expects |
| 12273 | +\tcode{order} is |
| 12274 | +neither \tcode{memory_order::release} nor \tcode{memory_order::acq_rel}. |
| 12275 | + |
| 12276 | +\pnum |
| 12277 | +\effects |
| 12278 | +Repeatedly performs the following steps, in order: |
| 12279 | +\begin{itemize} |
| 12280 | +\item |
| 12281 | + Evaluates \tcode{load(order)} and compares it to \tcode{old}. |
| 12282 | +\item |
| 12283 | + If the two are not equivalent, returns. |
| 12284 | +\item |
| 12285 | + Blocks until it |
| 12286 | + is unblocked by an atomic notifying operation or is unblocked spuriously. |
| 12287 | +\end{itemize} |
| 12288 | + |
| 12289 | +\pnum |
| 12290 | +\remarks |
| 12291 | +Two \tcode{weak_ptr} objects are equivalent |
| 12292 | +if they store the same pointer and either share ownership or are both empty. |
| 12293 | +This function is an atomic waiting operation\iref{atomics.wait}. |
| 12294 | +\end{itemdescr} |
| 12295 | + |
| 12296 | + |
| 12297 | +\indexlibrarymember{notify_one}{atomic<weak_ptr<T>>}% |
| 12298 | +\begin{itemdecl} |
| 12299 | +void notify_one() noexcept; |
| 12300 | +\end{itemdecl} |
| 12301 | + |
| 12302 | +\begin{itemdescr} |
| 12303 | +\pnum |
| 12304 | +\effects |
| 12305 | +Unblocks the execution of at least one atomic waiting operation |
| 12306 | +that is eligible to be unblocked\iref{atomics.wait} by this call, |
| 12307 | +if any such atomic waiting operations exist. |
| 12308 | + |
| 12309 | +\pnum |
| 12310 | +\remarks |
| 12311 | +This function is an atomic notifying operation\iref{atomics.wait}. |
| 12312 | +\end{itemdescr} |
| 12313 | + |
| 12314 | +\indexlibrarymember{notify_all}{atomic<weak_ptr<T>>}% |
| 12315 | +\begin{itemdecl} |
| 12316 | +void notify_all() noexcept; |
| 12317 | +\end{itemdecl} |
| 12318 | + |
| 12319 | +\begin{itemdescr} |
| 12320 | +\pnum |
| 12321 | +\effects |
| 12322 | +Unblocks the execution of all atomic waiting operations |
| 12323 | +that are eligible to be unblocked\iref{atomics.wait} by this call. |
| 12324 | + |
| 12325 | +\pnum |
| 12326 | +\remarks |
| 12327 | +This function is an atomic notifying operation\iref{atomics.wait}. |
| 12328 | +\end{itemdescr} |
12192 | 12329 | \indextext{atomic smart pointers|)}
|
12193 | 12330 |
|
12194 | 12331 | \rSec1[mem.res]{Memory resources}
|
|
0 commit comments