mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 05:26:24 +02:00
GE Debugger: Prevent hang on shutdown.
Since we're blocking the Emu thread, we can't use a hook from the Emu thread to wake up. The change to lifecycle callbacks caused this.
This commit is contained in:
1 parent
6c494c3849
commit
0ed2c03350
5 files changed
+23
-12
No files matched your search
+12
-4
@@ -54,7 +54,8 @@ static std::condition_variable m_InactiveCond;
|
||||
static std::mutex m_hInactiveMutex;
|
||||
static bool singleStepPending = false;
|
||||
static int steppingCounter = 0;
|
||||
static std::set<CoreLifecycleFunc> shutdownFuncs;
|
||||
static std::set<CoreLifecycleFunc> lifecycleFuncs;
|
||||
static std::set<CoreStopRequestFunc> stopFuncs;
|
||||
static bool windowHidden = false;
|
||||
static double lastActivity = 0.0;
|
||||
static double lastKeepAwake = 0.0;
|
||||
@@ -76,17 +77,24 @@ void Core_NotifyActivity() {
|
||||
}
|
||||
|
||||
void Core_ListenLifecycle(CoreLifecycleFunc func) {
|
||||
shutdownFuncs.insert(func);
|
||||
lifecycleFuncs.insert(func);
|
||||
}
|
||||
|
||||
void Core_NotifyLifecycle(CoreLifecycle stage) {
|
||||
for (auto it = shutdownFuncs.begin(); it != shutdownFuncs.end(); ++it) {
|
||||
(*it)(stage);
|
||||
for (auto func : lifecycleFuncs) {
|
||||
func(stage);
|
||||
}
|
||||
}
|
||||
|
||||
void Core_ListenStopRequest(CoreStopRequestFunc func) {
|
||||
stopFuncs.insert(func);
|
||||
}
|
||||
|
||||
void Core_Stop() {
|
||||
Core_UpdateState(CORE_POWERDOWN);
|
||||
for (auto func : stopFuncs) {
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
bool Core_IsStepping() {
|
||||
|
||||
Reference in new issue
Block a user