Are the hat pointers (ref pointers) atomic in C++/CX? And if no, what are the equivalents of std::atomic_load and std::atomic_store for them?
And how to make the following code thread-safe?
public ref class A sealed { ... };
A ^ p_a = nullptr;
A ^ p_a1 = ref new A();
//thread 1
p_a = p_a1;
//thread 2
p_saved = p_a;
if (p_saved != nullptr)
{
p_saved->Func();
}
For example,
std::atomic<A ^> p_a;
does not compile.