mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-10-11 22:49:56 +00:00
Host: Add RunOnGSThread helper
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user