Closed Bug 766696 Opened 12 years ago Closed 12 years ago

MessagePump's event loop doesn't wake up when idle-work is added to the queue

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox16 fixed)

RESOLVED FIXED
Firefox 16
Tracking Status
firefox16 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

I often see delays of ~10 seconds between two ScreenshotRunnables running, even though gecko isn't doing anything else in between. It looks like calling MessageLoop::current()->PostIdleTask doesn't wake up the message pump that may be sleeping in NS_ProcessNextEvent. This means if a whole bunch of ScreenshotRunnables get queued up, they may not get run during actual idle periods, and may only trickle out as various background timers fire. Another related problem is that the loop in MessagePump::Run should have a "continue" statement if DoIdleWork() returns true, so that it can process multiple pieces of idle work before going back to sleep.
This fixes the second part of the problem (not processing more than one idle work in a row), and is sufficient for the screenshot code. However it would be good to also fix the other problem (that of queueing idle work not waking up the message pump).
Attachment #635048 - Flags: review?(blassey.bugs)
Attachment #635048 - Flags: review?(blassey.bugs) → review+
Try run was pretty green, so landed on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/5bd5734369f7
OS: Linux → Android
Hardware: x86_64 → All
Target Milestone: --- → Firefox 16
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: