Last Comment Bug 777514 - B2G Updates: EventHub input loop stops the b2g process from exiting
: B2G Updates: EventHub input loop stops the b2g process from exiting
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget: Gonk (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Marshall Culpepper [:marshall_law]
:
Mentors:
Depends on: 776045
Blocks: b2g-gecko-updates
  Show dependency treegraph
 
Reported: 2012-07-25 14:39 PDT by Marshall Culpepper [:marshall_law]
Modified: 2012-08-09 04:53 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
event hub wake fix - v1 (792 bytes, patch)
2012-07-25 15:04 PDT, Marshall Culpepper [:marshall_law]
no flags Details | Diff | Review
event hub wake fix - v2 (958 bytes, patch)
2012-07-26 08:25 PDT, Marshall Culpepper [:marshall_law]
mwu.code: review+
Details | Diff | Review

Description Marshall Culpepper [:marshall_law] 2012-07-25 14:39:00 PDT
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.
Comment 1 Marshall Culpepper [:marshall_law] 2012-07-25 15:04:42 PDT
Created attachment 645897 [details] [diff] [review]
event hub wake fix - v1
Comment 2 Michael Wu [:mwu] 2012-07-25 18:45:07 PDT
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.
Comment 3 Marshall Culpepper [:marshall_law] 2012-07-26 08:18:38 PDT
(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.
Comment 4 Marshall Culpepper [:marshall_law] 2012-07-26 08:25:56 PDT
Created attachment 646148 [details] [diff] [review]
event hub wake fix - v2

Call requestExit() before waking the EventHub, and then join() (wait)
Comment 5 Marshall Culpepper [:marshall_law] 2012-07-26 10:55:12 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/d567f2581365
Comment 6 Matt Brubeck (:mbrubeck) 2012-07-26 11:14:41 PDT
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'
Comment 7 Marshall Culpepper [:marshall_law] 2012-07-26 11:24:37 PDT
Ugh, this looks like another Tinderbox GB toolchain issue. See Bug 776045
Comment 8 Marshall Culpepper [:marshall_law] 2012-08-08 12:33:38 PDT
In integration w/ GB safe APIs:

https://hg.mozilla.org/integration/mozilla-inbound/rev/0f7d2d447ed5
Comment 9 Ed Morley [:emorley] 2012-08-09 04:53:42 PDT
https://hg.mozilla.org/mozilla-central/rev/0f7d2d447ed5

Note You need to log in before you can comment on or make changes to this bug.