mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-11 16:46:16 +00:00
Better thread exit check
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user