From ec0f1f6720cd7ecffab54b0dfc2553b55a38e50f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Sun, 12 Jul 2009 23:11:20 -0700 Subject: 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. --- libs/surfaceflinger/MessageQueue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs/surfaceflinger/MessageQueue.cpp') 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"); -- cgit v1.2.3-59-g8ed1b