diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index b7df2a5c96..6d6fdfa9c9 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -302,3 +302,8 @@ void waiter_map_t::notify(u64 signal_id) } } } + +bool squeue_test_exit(const volatile bool* do_exit) +{ + return Emu.IsStopped() || (do_exit && *do_exit); +} diff --git a/Utilities/Thread.h b/Utilities/Thread.h index dbe12c6016..30ed0b0186 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -148,6 +148,8 @@ public: void notify(u64 signal_id); }; +bool squeue_test_exit(const volatile bool* do_exit); + template class squeue_t { @@ -207,7 +209,7 @@ public: return true; })) { - if (Emu.IsStopped() || (do_exit && *do_exit)) + if (squeue_test_exit(do_exit)) { return false; } @@ -258,7 +260,7 @@ public: return true; })) { - if (Emu.IsStopped() || (do_exit && *do_exit)) + if (squeue_test_exit(do_exit)) { return false; } @@ -341,7 +343,7 @@ public: return true; })) { - if (Emu.IsStopped() || (do_exit && *do_exit)) + if (squeue_test_exit(do_exit)) { return false; }