summaryrefslogtreecommitdiff
path: root/libs/surfaceflinger/MessageQueue.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2009-07-12 23:11:20 -0700
committer Mathias Agopian <mathias@google.com> 2009-07-13 15:14:23 -0700
commitec0f1f6720cd7ecffab54b0dfc2553b55a38e50f (patch)
tree58c51e2660462c6573f8a18e47b41f2460d5d1ea /libs/surfaceflinger/MessageQueue.cpp
parent98b34b3fffe50e8e4e62d76631c79edaa0b28b70 (diff)
implement Mutex and Condition with pthread instead of calling futex directly.
internally pthread uses futex. the implementation consists of simple inlines there are no implementation files anymore.
Diffstat (limited to 'libs/surfaceflinger/MessageQueue.cpp')
-rw-r--r--libs/surfaceflinger/MessageQueue.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/surfaceflinger/MessageQueue.cpp b/libs/surfaceflinger/MessageQueue.cpp
index fb70b6a81b..b43d80173a 100644
--- a/libs/surfaceflinger/MessageQueue.cpp
+++ b/libs/surfaceflinger/MessageQueue.cpp
@@ -111,7 +111,10 @@ MessageList::value_type MessageQueue::waitMessage(nsecs_t timeout)
if (nextEventTime > 0) {
// we're about to wait, flush the binder command buffer
IPCThreadState::self()->flushCommands();
- mCondition.wait(mLock, nextEventTime);
+ const nsecs_t reltime = nextEventTime - systemTime();
+ if (reltime > 0) {
+ mCondition.waitRelative(mLock, reltime);
+ }
}
} else {
//LOGD("going to wait");