A QEMU realized paused (-S) and quit 3 s later ended in SIGSEGV (potluck
m3-max-86030, an AMD host with NVIDIA's driver installed): QEMU's cleanup
quiesced the library, the quiesce answered that the process may exit, and
exit() ran the exit handlers while reims-vgpu.ui was still in the window's
opening, where SDL_CreateWindow with SDL_WINDOW_VULKAN had the Vulkan loader
start NVIDIA's driver. The UI thread's jobs were no steps of the exit gate, so
the quiesce did not wait for them.
SDL's video start and each job posted to the UI thread on Linux and Windows
are steps now, each job's begun where it was posted. For the host: a quit
that comes during a window's opening waits for it, and where the opening
outlasts the quiesce's bound (QEMU's 5 s) QEMU ends with _exit, so the
driver's exit handlers never run beside it; a job taken after the gate closed
parks the UI thread unrun.
The test runs the UI thread's job loop in a child process, an opening held
300 ms with a job queued behind it. Before the change a close of the gate
with a 50 ms deadline answered true during the opening and the job behind it
ran (red on Linux, potluck m3-max-86131); after it, 158 of 158 of the window
crate's tests pass there (m3-max-86135).
(cherry picked from commit 2454db1085bb74e8dfc147726e1c268d1811386f)
(cherry picked from commit 0a2738f8586555273a76b2f22f45103aa4beacd4)