diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 00:53:47 -0400 |
|---|---|---|
| committer | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 00:53:47 -0400 |
| commit | 636d4526108a682aa2e344bcb4a9ad1eafecc52e (patch) | |
| tree | feff3e67f7dcc8dd912e5ddf3855916e06a47af7 /src/core/core_timing.cpp | |
| parent | d56039ace99338293658f931a871e4dba203e3ab (diff) | |
core_timing: request the timer thread's stop before waking it
CoreTiming::Reset set pause_event and event, and only then requested the
stop. The woken timer thread could take the wake-up, still see no stop
request, and go back to waiting on pause_event for good; the join that
follows then hung the frontend while booting a game ("Not Responding",
main thread in CoreTiming::Reset -> std::thread::join). Request the stop
first, so the thread sees it whenever it wakes.
Diffstat (limited to 'src/core/core_timing.cpp')
| -rw-r--r-- | src/core/core_timing.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index d2ee6769cc..b85bd30a58 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -304,10 +304,15 @@ std::optional<s64> CoreTiming::Advance() { void CoreTiming::Reset() { paused = true; + // Request the stop before waking the thread: woken first, it could take the wake-up, see no + // stop request yet, and go back to waiting on pause_event for good (the join below then hung + // the frontend at boot). + if (timer_thread.joinable()) { + timer_thread.request_stop(); + } pause_event.Set(); event.Set(); if (timer_thread.joinable()) { - timer_thread.request_stop(); timer_thread.join(); } has_started = false; |
