diff options
author | 2009-07-12 23:11:20 -0700 | |
---|---|---|
committer | 2009-07-13 15:14:23 -0700 | |
commit | b1c4ca5ad21ae63cd5af2cfc1be82ba176d25195 (patch) | |
tree | 5a70f426d9b4cd75638a1b17ae2abd264c59eb55 /libs/surfaceflinger/MessageQueue.cpp | |
parent | 56e7c2d6ebbde59555041e3550cbba6824486db1 (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.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/surfaceflinger/MessageQueue.cpp b/libs/surfaceflinger/MessageQueue.cpp index fb70b6a81be8..b43d80173a3f 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"); |