fix(handoff): spawn blocks signals and cancellation across the fork; root flag stored under the stop lock

This commit is contained in:
Kurt Himebauch committed 2026-12-01 10:27:44 -05:00
1 parent 9f5c35f088
commit feedf92d3e
2 files changed
+42 -2

No files matched your search

@@ -902,7 +902,13 @@ class SessionService : Service() {
return
}
sessionPid = pid
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = com.droiddeck.launcher.runtime.GuestWorkers.runsInWorker(pid)
// Under the lock Stop clears it with, and only while this session still runs: a Stop since the
// check above has cleared it already, and this would set it again for no running session.
val uncounted = com.droiddeck.launcher.runtime.GuestWorkers.runsInWorker(pid)
synchronized(stopLock) {
if (gen == sessionGen && SessionState.running)
com.droiddeck.launcher.runtime.GuestWorkers.sessionRootUncounted = uncounted
}
if (pid > 1) {
raiseTracer(pid, gen)
SessionEvents.guestStarted(pid)