Better thread exit check

This commit is contained in:
momo5502
2025-01-18 19:37:43 +01:00
parent a16c17669d
commit 270dbf000c
2 changed files with 9 additions and 2 deletions

View File

@@ -379,6 +379,8 @@ class emulator_thread : ref_counted_object
return this->await_time.has_value() && this->await_time.value() < std::chrono::steady_clock::now();
}
bool is_terminated() const;
bool is_thread_ready(windows_emulator& win_emu);
void save(x64_emulator& emu)

View File

@@ -638,7 +638,7 @@ namespace
const auto* t = c.threads.get(h);
if (t)
{
return t->exit_status.has_value();
return t->is_terminated();
}
break;
@@ -693,9 +693,14 @@ void emulator_thread::mark_as_ready(const NTSTATUS status)
this->waiting_for_alert = false;
}
bool emulator_thread::is_terminated() const
{
return this->exit_status.has_value();
}
bool emulator_thread::is_thread_ready(windows_emulator& win_emu)
{
if (this->exit_status.has_value())
if (this->is_terminated())
{
return false;
}