metal: serve ends cleanly after QUIT (Metal-only _Exit)

The stdin reader (a detached thread) can take in_mu after the serve scope destroyed it, when the server closes the
pipe after QUIT; on macOS that lock throws and the engine ended with an abort. Inside #if STRATA_GPU_METAL: flush
and _Exit(0) after the QUIT profile save. HIP (p620): generate.cpp preprocesses IDENTICAL and its object is
byte-IDENTICAL against the gated tree (P2003 was unreachable for the CUDA compare; the change is preprocessor-only).
This commit is contained in:
Niko1221 committed 2026-10-12 19:37:53 +02:00
1 parent e30cffb8f8
commit b66c61984b
1 file changed
+7
+7
View File
@@ -12537,6 +12537,13 @@ int main(int argc, char** argv) {
}
}
save_profile("exit"); // #477: QUIT, or the server closed stdin
#if defined(STRATA_GPU_METAL)
// the stdin reader (detached above) may still take in_mu when the server closes the pipe after QUIT; on macOS
// locking that mutex once this scope has destroyed it throws (the engine ended with an abort): end here
std::fflush(stdout);
std::fflush(stderr);
std::_Exit(0);
#endif
return 0;
}