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:54:36 -0400 |
| commit | b937805eb573cbad52fc698fd149752eae0ddc81 (patch) | |
| tree | 87ab98cc9515591bba04c70bb389425437b25e77 /src/core | |
| parent | f0faf0f6d29ecfa2a244dcb2c73ca1a494afe75c (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')
| -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; |
