diff options
author | 2011-12-02 16:11:19 -0800 | |
---|---|---|
committer | 2011-12-02 16:11:19 -0800 | |
commit | 21808bb46da7e576c4a6e619fd928f79fa9559d1 (patch) | |
tree | a0426f506190419323d7fb622d384c491ea8bb78 /services/surfaceflinger/MessageQueue.cpp | |
parent | 29f1c32eea12ab33547af73fb0e5dcf432e6979c (diff) |
fix an issue where updates could starve transactions
Bug: 5700586
Change-Id: Iaa4adc1a6aea1db6e2943efe4caca1f6cbebfa72
Diffstat (limited to 'services/surfaceflinger/MessageQueue.cpp')
-rw-r--r-- | services/surfaceflinger/MessageQueue.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp index 1846ccb31604..fdde75c0a0e8 100644 --- a/services/surfaceflinger/MessageQueue.cpp +++ b/services/surfaceflinger/MessageQueue.cpp @@ -44,8 +44,7 @@ void MessageBase::handleMessage(const Message&) { // --------------------------------------------------------------------------- MessageQueue::MessageQueue() - : mLooper(new Looper(true)), - mInvalidatePending(0) + : mLooper(new Looper(true)) { } @@ -54,17 +53,13 @@ MessageQueue::~MessageQueue() { void MessageQueue::waitMessage() { do { - // handle invalidate events first - if (android_atomic_and(0, &mInvalidatePending) != 0) - break; - IPCThreadState::self()->flushCommands(); int32_t ret = mLooper->pollOnce(-1); switch (ret) { case ALOOPER_POLL_WAKE: // we got woken-up there is work to do in the main loop - continue; + return; case ALOOPER_POLL_CALLBACK: // callback was handled, loop again @@ -99,7 +94,6 @@ status_t MessageQueue::postMessage( } status_t MessageQueue::invalidate() { - android_atomic_or(1, &mInvalidatePending); mLooper->wake(); return NO_ERROR; } |