summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/MessageQueue.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-07-12 23:11:20 -0700
committerMathias Agopian <mathias@google.com>2009-07-13 15:14:23 -0700
commitb1c4ca5ad21ae63cd5af2cfc1be82ba176d25195 (patch)
tree5a70f426d9b4cd75638a1b17ae2abd264c59eb55 /libs/surfaceflinger/MessageQueue.cpp
parent56e7c2d6ebbde59555041e3550cbba6824486db1 (diff)
downloadframeworks_base-b1c4ca5ad21ae63cd5af2cfc1be82ba176d25195.zip
frameworks_base-b1c4ca5ad21ae63cd5af2cfc1be82ba176d25195.tar.gz
frameworks_base-b1c4ca5ad21ae63cd5af2cfc1be82ba176d25195.tar.bz2
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 fb70b6a..b43d801 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");