Migration to named_thread<>

Add atomic_t<>::try_dec instead of fetch_dec_sat
Add atomic_t<>::try_inc
GDBDebugServer is broken (needs rewrite)
Removed old_thread class (former named_thread)
Removed storing/rethrowing exceptions from thread
Emu.Stop doesn't inject an exception anymore
task_stack helper class removed
thread_base simplified (no shared_from_this)
thread_ctrl::spawn simplified (creates detached thread)
Implemented overrideable thread detaching logic
Disabled cellAdec, cellDmux, cellFsAio
SPUThread renamed to spu_thread
RawSPUThread removed, spu_thread used instead
Disabled deriving from ppu_thread
Partial support for thread renaming
lv2_timer... simplified, screw it
idm/fxm: butchered support for on_stop/on_init
vm: improved allocation structure (added size)
This commit is contained in:
Nekotekina 2018-10-11 01:17:19 +03:00
parent 8ca6c9fff0
commit 1b37e775be
82 changed files with 1820 additions and 2023 deletions

View file

@ -1002,13 +1002,13 @@ DECLARE(lv2_obj::g_ppu);
DECLARE(lv2_obj::g_pending);
DECLARE(lv2_obj::g_waiting);
void lv2_obj::sleep_timeout(old_thread& thread, u64 timeout)
void lv2_obj::sleep_timeout(cpu_thread& thread, u64 timeout)
{
std::lock_guard lock(g_mutex);
const u64 start_time = get_system_time();
if (auto ppu = dynamic_cast<ppu_thread*>(&thread))
if (auto ppu = static_cast<ppu_thread*>(thread.id_type() == 1 ? &thread : nullptr))
{
LOG_TRACE(PPU, "sleep() - waiting (%zu)", g_pending.size());
@ -1123,7 +1123,7 @@ void lv2_obj::awake(cpu_thread& cpu, u32 prio)
}
// Remove pending if necessary
if (!g_pending.empty() && cpu.get() == thread_ctrl::get_current())
if (!g_pending.empty() && &cpu == get_current_cpu_thread())
{
unqueue(g_pending, &cpu);
}
@ -1165,7 +1165,7 @@ void lv2_obj::schedule_all()
target->state ^= (cpu_flag::signal + cpu_flag::suspend);
target->start_time = 0;
if (target->get() != thread_ctrl::get_current())
if (target != get_current_cpu_thread())
{
target->notify();
}