According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57250, GCC 4.9 has support for atomic shared_ptr
operations.
Using GCC 4.9.2,
"atomic shared_ptr
operations" refers to the free std::atomic_(store|load|exchange|compare_exchange_strong|compare_exchange_weak)(_explicit)?
function templates for shared_ptr
, documented here. GCC doesn't have them until 5. (Fun fact: its implementation actually uses a global array of 16 mutexes under the hood.)
Instantiating std::atomic
over std::shared_ptr
results in undefined behavior, as std::atomic
requires a trivially copyable type.
The concurrency TS has std::experimental::atomic_shared_ptr
.