Add g_fxo->init_crtp to simplify thread construction

This commit is contained in:
Nekotekina 2020-02-25 11:51:41 +03:00
parent 7eebe06931
commit fa02a04baa
3 changed files with 14 additions and 11 deletions

View file

@ -498,7 +498,7 @@ namespace rsx
vblank_count = 0;
auto vblank_body = [this]()
g_fxo->init_crtp<named_thread>("VBlank Thread", [this]()
{
// See sys_timer_usleep for details
#ifdef __linux__
@ -562,11 +562,9 @@ namespace rsx
thread_ctrl::wait_for(100);
}
};
});
g_fxo->init<named_thread<decltype(vblank_body)>>("VBlank Thread", std::move(vblank_body));
auto decomp_body = [this]
g_fxo->init_crtp<named_thread>("RSX Decompiler Thread", [this]
{
if (g_cfg.video.disable_asynchronous_shader_compiler)
{
@ -597,9 +595,7 @@ namespace rsx
}
on_decompiler_exit();
};
g_fxo->init<named_thread<decltype(decomp_body)>>("RSX Decompiler Thread", std::move(decomp_body));
});
// Raise priority above other threads
thread_ctrl::set_native_priority(1);