Core: Support asynchronously executing functions on the CPU thread
The CPU thread will be interrupted to execute the callback, and then restored to its old state after execution completes.
This commit is contained in:
1 parent
29ba53f6c3
commit
df45e714a3
4 files changed
+80
-2
No files matched your search
@@ -82,6 +82,10 @@ void UpdateTitle();
|
||||
// This should only be called from the CPU thread or the host thread.
|
||||
void RunAsCPUThread(std::function<void()> function);
|
||||
|
||||
// Run a function on the CPU thread, asynchronously.
|
||||
// This is only valid to call from the host thread, since it uses PauseAndLock() internally.
|
||||
void RunOnCPUThread(std::function<void()> function, bool wait_for_completion);
|
||||
|
||||
// for calling back into UI code without introducing a dependency on it in core
|
||||
using StateChangedCallbackFunc = std::function<void(Core::State)>;
|
||||
void SetOnStateChangedCallback(StateChangedCallbackFunc callback);
|
||||
|
||||
Reference in new issue
Block a user