summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-10-07 19:59:06 -0700
committerMathias Agopian <mathias@google.com>2010-10-11 12:40:09 -0700
commit23a0920339a04c0fcfc3a2840f4e020040c2afbf (patch)
tree249cf04be191f33233876887d2cb5d1563de2142 /services/surfaceflinger
parentf1598c54421aa93385f520e7dd7432956a48eb86 (diff)
downloadframeworks_native-23a0920339a04c0fcfc3a2840f4e020040c2afbf.zip
frameworks_native-23a0920339a04c0fcfc3a2840f4e020040c2afbf.tar.gz
frameworks_native-23a0920339a04c0fcfc3a2840f4e020040c2afbf.tar.bz2
fix a bug where timeouts would only be handled when a message was delivered
Change-Id: I98c69b129e75e065e61f47e54f0f855d9401b0dc
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;
}
}