Remove cancerous lf_value<>

Replace thread names (generic, PPU, SPU) with new shared pointers.
Devirtualize cpu_thread::get_name (used in single case).
This commit is contained in:
Nekotekina 2020-02-28 10:43:37 +03:00
parent bf4bdf73b7
commit 65eeee0f4c
11 changed files with 99 additions and 122 deletions

View file

@ -512,7 +512,7 @@ void cpu_thread::notify()
}
else
{
fmt::throw_exception("Invalid cpu_thread type");
fmt::throw_exception("Invalid cpu_thread type" HERE);
}
}
@ -529,7 +529,24 @@ void cpu_thread::abort()
}
else
{
fmt::throw_exception("Invalid cpu_thread type");
fmt::throw_exception("Invalid cpu_thread type" HERE);
}
}
std::string cpu_thread::get_name() const
{
// Downcast to correct type
if (id_type() == 1)
{
return thread_ctrl::get_name(*static_cast<const named_thread<ppu_thread>*>(this));
}
else if (id_type() == 2)
{
return thread_ctrl::get_name(*static_cast<const named_thread<spu_thread>*>(this));
}
else
{
fmt::throw_exception("Invalid cpu_thread type" HERE);
}
}