mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
shared_ptr.hpp: add trivial conversion for shared/single types
These conversions don't exist in std::shared_ptr-alike types. But I don't want to bother with == operators until we have proper C++20. Removed trivial conversion for atomic_ptr because it's heavyweight.
This commit is contained in:
parent
3a0b3a85a5
commit
77aa9e58f2
4 changed files with 31 additions and 8 deletions
|
@ -2250,7 +2250,13 @@ std::string thread_ctrl::get_name_cached()
|
|||
|
||||
if (!_this->m_tname.is_equal(name_cache)) [[unlikely]]
|
||||
{
|
||||
name_cache = _this->m_tname.load();
|
||||
_this->m_tname.peek_op([&](const shared_ptr<std::string>& ptr)
|
||||
{
|
||||
if (ptr != name_cache)
|
||||
{
|
||||
name_cache = ptr;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return *name_cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue