Log the guest's ExitProcess line after the exit guard, and bring the comments on gfx_window_closed's return up to date.

The review of the exit sequence found that svc.c case 0x07 logged "guest ExitProcess at ...; exiting" before
rt_exit_begin. When a close had already begun, the guest thread that the guard then parks still claimed to exit, and
past the log cap the line fell outside the end's reserve, which rt_exit_begin opens. It also found that host.h and
gfx_wsys.h still said gfx_window_closed does not return, though it returns for its own thread coming back, and that
rt_exit_begin's comment spoke of the window thread handling a message inside the sequence, which since the close
runs on a thread of its own happens only in the fallback.

svc.c logs the line after rt_exit_begin returns 1. The two header comments say gfx_window_closed returns only for its
own thread coming back (gfx_present.c rt_exit_begin), and rt_exit_begin's comment says the window thread runs the
sequence itself only when gfx_window_win.c exit_start could make no thread.

tests/exit_order_check.py checks statically that 0x07's rt_log comes after rt_exit_begin; it fails on the code
before this change and passes after it. exit_order_check and the compile check of every runtime file (a header
changed) pass, with no new -Wall warnings in svc.c and gfx_present.c.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 18:32:04 -05:00
parent 66c607414b
commit cd3f015732
5 changed files with 19 additions and 8 deletions

View File

@@ -116,7 +116,9 @@ void perf_summary_flush(void); // prints the frame-time summary
void perf_summary_flush_try(void); // the same at a fatal error, the stutter map only if its lock is free
void perf_focus_lost(void); // the window lost the focus: the session's reports at the next present, in play
void gfx_exit_log(void); // back end's lines for the exit summary (weak no-op in prof_win.c)
void gfx_window_closed(void); // gfx_present.c (gfx_wsys.h): the end of a closed window; does not return
// gfx_present.c (gfx_wsys.h): the end of a closed window. It does not return, but for its own thread coming back
// (gfx_present.c rt_exit_begin)
void gfx_window_closed(void);
// gfx_present.c: the orderly end every exit the game asks for shares (the window's close, svc.c ExitProcess, boot.c
// --seconds). rt_exit_begin: 1 for the first caller; another thread waits there for good; 0 for that caller's own
// thread again. rt_exit_steps: the saves and the put-backs, the slow pipeline save late and the final save flush last.