Homebrew atomic_ptr rewritten (util/shared_ptr.hpp)

It's analogous to C++20 atomic std::shared_ptr

The following things brought into global namespace:
single_ptr
shared_ptr
atomic_ptr
make_single
This commit is contained in:
Nekotekina 2020-11-26 12:30:51 +03:00
parent bd90e3e37f
commit b5d498ffda
15 changed files with 732 additions and 597 deletions

View file

@ -2242,7 +2242,7 @@ std::string thread_ctrl::get_name_cached()
return {};
}
static thread_local stx::shared_cptr<std::string> name_cache;
static thread_local shared_ptr<std::string> name_cache;
if (!_this->m_tname.is_equal(name_cache)) [[unlikely]]
{
@ -2254,7 +2254,7 @@ std::string thread_ctrl::get_name_cached()
thread_base::thread_base(native_entry entry, std::string_view name)
: entry_point(entry)
, m_tname(stx::shared_cptr<std::string>::make(name))
, m_tname(make_single<std::string>(name))
{
}