diff options
| author | 2010-10-07 19:59:06 -0700 | |
|---|---|---|
| committer | 2010-10-07 19:59:06 -0700 | |
| commit | ad8d48a6b61436c2c9e37b2b576da60c09a2157f (patch) | |
| tree | ef7bc790b2e688890887a0155d21b9d798b45436 /services/surfaceflinger/MessageQueue.cpp | |
| parent | 3e1a18ac6d9a29a987514b4fe03371336184b1cc (diff) | |
fix a bug where timeouts would only be handled when a message was delivered
Change-Id: Id3127b21c1a1a1afab32911a8edbb202360d7c9b
Diffstat (limited to 'services/surfaceflinger/MessageQueue.cpp')
| -rw-r--r-- | services/surfaceflinger/MessageQueue.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp index d668e88d471f..4fb1e6133b1c 100644 --- a/services/surfaceflinger/MessageQueue.cpp +++ b/services/surfaceflinger/MessageQueue.cpp @@ -91,17 +91,21 @@ sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout) mMessages.remove(cur); break; } - if (timeout>=0 && timeoutTime < now) { - // we timed-out, return a NULL message - result = 0; - break; - } nextEventTime = result->when; result = 0; } - if (timeout >= 0 && nextEventTime > 0) { - if (nextEventTime > timeoutTime) { + if (timeout >= 0) { + if (timeoutTime < now) { + // we timed-out, return a NULL message + result = 0; + break; + } + if (nextEventTime > 0) { + if (nextEventTime > timeoutTime) { + nextEventTime = timeoutTime; + } + } else { nextEventTime = timeoutTime; } } |