fixed_typemap.hpp: add range iterator

Remove recently added functions.
This commit is contained in:
Nekotekina 2021-06-08 23:12:40 +03:00
parent 4f76211551
commit 2d3fe7ce1c
3 changed files with 53 additions and 25 deletions

View file

@ -1542,31 +1542,23 @@ void Emulator::Stop(bool restart)
cpu_thread::stop_all();
using fxo_t = std::remove_pointer_t<decltype(g_fxo)>;
// Signal threads
for (const auto& type : fxo_t::view_typelist())
for (const auto& [type, data] : *g_fxo)
{
if (type.stop)
{
if (auto data = g_fxo->try_get(type))
{
type.stop(data, thread_state::aborting);
}
type.stop(data, thread_state::aborting);
}
}
GetCallbacks().on_stop();
// Join threads
for (const auto& type : fxo_t::view_typelist())
for (const auto& [type, data] : *g_fxo)
{
if (type.stop)
{
if (auto data = g_fxo->try_get(type))
{
type.stop(data, thread_state::finished);
}
type.stop(data, thread_state::finished);
}
}