Currently, process exit will block when ~nsAppShell calls mReaderThread->requestExitAndWait(). This requires the user to do some form of input (touch or button press of some kind) to tick the EventHub loop, and finalize the b2g process teardown.
Created attachment 645897 [details] [diff] [review] event hub wake fix - v1
Hm, can we request an exit, wake, and then wait for exit? I'm a bit afraid that we might wake up, and then go straight back to waiting before we call the exit and wait function.
(In reply to Michael Wu [:mwu] from comment #2) > Hm, can we request an exit, wake, and then wait for exit? I'm a bit afraid > that we might wake up, and then go straight back to waiting before we call > the exit and wait function. Good catch! It looks like we can actually separate out the calls to requestExit() and join() (for waiting), so I'll add the call to mEventHub->wake() between the two, to avoid the second request.
Created attachment 646148 [details] [diff] [review] event hub wake fix - v2 Call requestExit() before waking the EventHub, and then join() (wait)
Sorry, I backed this out on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/7ac08cd7d0a3 because of B2G build failures: https://tbpl.mozilla.org/php/getParsedLog.php?id=13879519&tree=Mozilla-Inbound ../../../widget/gonk/nsAppShell.cpp:501: error: 'class android::InputReaderThread' has no member named 'join'
Ugh, this looks like another Tinderbox GB toolchain issue. See Bug 776045
In integration w/ GB safe APIs: https://hg.mozilla.org/integration/mozilla-inbound/rev/0f7d2d447ed5