std::atomic_is_lock_free<std::shared_ptr>, std::atomic_load<std::shared_ptr>, std::atomic_store<std::shared_ptr>, std::atomic_...<std::shared_ptr>
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
template< class T > bool atomic_is_lock_free( const std::shared_ptr<T>* p ); |
(1) | (C++11 起) |
template< class T > std::shared_ptr<T> atomic_load( const std::shared_ptr<T>* p ); |
(2) | (C++11 起) |
template< class T > std::shared_ptr<T> atomic_load_explicit( const shared_ptr<T>* p, |
(3) | (C++11 起) |
template< class T > void atomic_store( std::shared_ptr<T>* p, |
(4) | (C++11 起) |
template< class T > void atomic_store_explicit( std::shared_ptr<T>* p, |
(5) | (C++11 起) |
template< class T > std::shared_ptr<T> atomic_exchange( std::shared_ptr<T>* p, |
(6) | (C++11 起) |
template<class T> std::shared_ptr<T> atomic_exchange_explicit( std::shared_ptr<T>* p, |
(7) | (C++11 起) |
template< class T > bool atomic_compare_exchange_weak( std::shared_ptr<T>* p, |
(8) | (C++11 起) |
template<class T> bool atomic_compare_exchange_strong( std::shared_ptr<T>* p, |
(9) | (C++11 起) |
template< class T > bool atomic_compare_exchange_strong_explicit( std::shared_ptr<T>* p, |
(10) | (C++11 起) |
template< class T > bool atomic_compare_exchange_weak_explicit( std::shared_ptr<T>* p, |
(11) | (C++11 起) |
p
是无锁的p
is lock-free.p
。至于与非专门std::atomic_load_explicit,mo
不能是std::memory_order_release或std::memory_order_acq_relp
. As with the non-specialized std::atomic_load_explicit, mo
cannot be std::memory_order_release or std::memory_order_acq_relp
和r
,有效地执行p->swap(r)。至于与非专门std::atomic_store_explicit,mo
不能是std::memory_order_acquire或std::memory_order_acq_relp
and r
, effectively executing p->swap(r). As with the non-specialized std::atomic_store_explicit, mo
cannot be std::memory_order_acquire or std::memory_order_acq_relp
,r
p->swap(r),有效地执行,并返回一个副本的共享指针前身为指向的p
p
and r
, effectively executing p->swap(r) and returns a copy of the shared pointer formerly pointed-to by p
p
和expected
。如果他们是等价的(股份拥有权相同的指针,是指在同一个指针),分配desired
到*p
使用的内存success
,并返回true指定顺序的约束。如果他们是不等价的,分配*p
到*expected
使用内存排序failure
返回指定约束false.p
and expected
. If they are equivalent (share ownership of the same pointer and refer to the same pointer), assigns desired
into *p
using the memory ordering constraints specified by success
and returns true. If they are not equivalent, assigns *p
into *expected
using the memory ordering constraints specified by failure
and returns false.p
是一个空指针.p
is a null pointer.目录 |
[编辑] 参数
p, expected | - | 一个指针到std::shared_ptr
|
r, desired | - | a std::shared_ptr |
mo, success, failure | - | 内存排序类型std::memory_order的选择
原文: memory ordering selectors of type std::memory_order |
[编辑] 例外
[编辑] 返回
[编辑] 另请参阅
(C++11) |
检查对该原子类型的操作是否是锁无关的 (函数模板) |
(C++11) (C++11) |
以原子的原子对象的值替换的非原子的说法 原文: atomically replaces the value of the atomic object with a non-atomic argument (函数模板) |
(C++11) (C++11) |
原子获得的值存储在一个原子对象 原文: atomically obtains the value stored in an atomic object (函数模板) |
(C++11) (C++11) |
以原子的原子对象非原子参数的值替换,并返回旧值的原子 原文: atomically replaces the value of the atomic object with non-atomic argument and returns the old value of the atomic (函数模板) |
原子原子对象与非原子的参数的值的比较,并执行原子交换,如果等于或原子的负载如果不是 原文: atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not (函数模板) |