diff options
| author | 2009-07-13 21:27:38 -0700 | |
|---|---|---|
| committer | 2009-07-13 21:27:38 -0700 | |
| commit | 3a5351e4437fc2c220bc68a431bd4a1a00a653fa (patch) | |
| tree | 67f35319503a34a2b3fa4b3b920ae8370681c2a0 /libs/surfaceflinger/MessageQueue.cpp | |
| parent | a533f85ec6dff418174f22388e853689eb144f13 (diff) | |
| parent | b1c4ca5ad21ae63cd5af2cfc1be82ba176d25195 (diff) | |
Merge change 6898
* changes:
implement Mutex and Condition with pthread instead of calling futex directly.
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"); |