这问题一直是让我很难理解
我看了 cppreference, 他提到 你只要用了non-const method的话就不thread safe
问题出在
https://en.cppreference.com/w/cpp/memory/shared_ptr/operator%3D
这不是non-const , 而我看到的程式码(也许早就写错了)
我并没有看到mutex or 一些保护机制去保护shared_ptr assignment
假设一个情况
Thread1
mSp = nullptr; 内部应该是refcount