diff --git a/src/windows-emulator/process_context.hpp b/src/windows-emulator/process_context.hpp index 2bf037a2..02513286 100644 --- a/src/windows-emulator/process_context.hpp +++ b/src/windows-emulator/process_context.hpp @@ -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) diff --git a/src/windows-emulator/windows_emulator.cpp b/src/windows-emulator/windows_emulator.cpp index 96b11bc4..5836ae06 100644 --- a/src/windows-emulator/windows_emulator.cpp +++ b/src/windows-emulator/windows_emulator.cpp @@ -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; }