summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-11 12:44:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-11 12:44:23 -0700
commit8b8a8f65b5306aa557028feba7317470222a73df (patch)
tree7875495d474cfe45afa2a32aed483c3d23be26e9 /services/surfaceflinger
parent5b0d063010b364102ffb7a533e2b76ecfd9636d5 (diff)
parenta7c76d8307a3b49bf5b8fdda3543455b0e5dd64c (diff)
downloadframeworks_base-8b8a8f65b5306aa557028feba7317470222a73df.zip
frameworks_base-8b8a8f65b5306aa557028feba7317470222a73df.tar.gz
frameworks_base-8b8a8f65b5306aa557028feba7317470222a73df.tar.bz2
am a7c76d83: Merge "fix a bug where timeouts would only be handled when a message was delivered" into gingerbread
Merge commit 'a7c76d8307a3b49bf5b8fdda3543455b0e5dd64c' into gingerbread-plus-aosp * commit 'a7c76d8307a3b49bf5b8fdda3543455b0e5dd64c': fix a bug where timeouts would only be handled when a message was delivered
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/MessageQueue.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp
index d668e88..4fb1e61 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;
}
}