1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Emu: Add more info to BlockingCallFromMainThread

This commit is contained in:
Megamouse 2024-01-20 23:19:20 +01:00
parent efea3aa385
commit 8a87dc63b1
2 changed files with 10 additions and 3 deletions

View File

@ -179,7 +179,7 @@ void Emulator::CallFromMainThread(std::function<void()>&& func, atomic_t<u32>* w
m_cb.call_from_main_thread(std::move(final_func), wake_up);
}
void Emulator::BlockingCallFromMainThread(std::function<void()>&& func) const
void Emulator::BlockingCallFromMainThread(std::function<void()>&& func, u32 line, u32 col, const char* file, const char* fun) const
{
atomic_t<u32> wake_up = 0;
@ -187,7 +187,10 @@ void Emulator::BlockingCallFromMainThread(std::function<void()>&& func) const
while (!wake_up)
{
ensure(thread_ctrl::get_current());
if (!thread_ctrl::get_current())
{
fmt::throw_exception("Current thread null while calling BlockingCallFromMainThread from %s", src_loc{line, col, file, fun});
}
wake_up.wait(0);
}
}

View File

@ -185,7 +185,11 @@ public:
void CallFromMainThread(std::function<void()>&& func, atomic_t<u32>* wake_up = nullptr, bool track_emu_state = true, u64 stop_ctr = umax) const;
// Blocking call from the GUI thread
void BlockingCallFromMainThread(std::function<void()>&& func) const;
void BlockingCallFromMainThread(std::function<void()>&& func,
u32 line = __builtin_LINE(),
u32 col = __builtin_COLUMN(),
const char* file = __builtin_FILE(),
const char* fun = __builtin_FUNCTION()) const;
enum class stop_counter_t : u64{};