About thread-safety of weak_ptr
I know I’m late, but this comes up when searching for “weak_ptr thread”, and Casey’s answer just isn’t the whole truth. Both shared_ptr and weak_ptr can be used from threads without further synchronization. For shared_ptr, there’s a lot of documentation (e.g. on cppreference.com or on stackoverflow). You can safely access shared_ptr‘s that point to the … Read more