Host: Add RunOnGSThread helper

This commit is contained in:
TellowKrinkle
2026-03-07 09:12:00 -05:00
committed by Ty
parent 9fb889a85b
commit 40a5f1a13d
3 changed files with 12 additions and 0 deletions
+5
View File
@@ -1212,6 +1212,11 @@ void Host::RunOnCPUThread(std::function<void()> function, bool block /* = false
Q_ARG(const std::function<void()>&, std::move(function)));
}
void Host::RunOnGSThread(std::function<void()> function)
{
RunOnCPUThread([fn = std::move(function)] { MTGS::RunOnGSThread(std::move(fn)); });
}
void Host::RefreshGameListAsync(bool invalidate_cache)
{
QMetaObject::invokeMethod(g_main_window, "refreshGameList", Qt::QueuedConnection, Q_ARG(bool, invalidate_cache));
+3
View File
@@ -84,6 +84,9 @@ namespace Host
/// Safely executes a function on the VM thread.
void RunOnCPUThread(std::function<void()> function, bool block = false);
/// Safely executes a function on the GS thread.
void RunOnGSThread(std::function<void()> function);
/// Asynchronously starts refreshing the game list.
void RefreshGameListAsync(bool invalidate_cache);
+4
View File
@@ -156,6 +156,10 @@ void Host::RunOnCPUThread(std::function<void()> function, bool block /* = false
{
}
void Host::RunOnGSThread(std::function<void()> function)
{
}
void Host::RefreshGameListAsync(bool invalidate_cache)
{
}