am 95482b61: Merge "Fix an issue where we could wait for a non-existing transaction" into ics-mr1

* commit '95482b61c348fc54bf44a96a8b73011c90b40520':
  Fix an issue where we could wait for a non-existing transaction
This commit is contained in:
Mathias Agopian
2011-11-09 14:36:11 +00:00
committed by Android Git Automerger

View File

@@ -1217,23 +1217,25 @@ void SurfaceFlinger::setTransactionState(const Vector<ComposerState>& state,
sp<Client> client( static_cast<Client *>(s.client.get()) ); sp<Client> client( static_cast<Client *>(s.client.get()) );
transactionFlags |= setClientStateLocked(client, s.state); transactionFlags |= setClientStateLocked(client, s.state);
} }
if (transactionFlags) {
setTransactionFlags(transactionFlags);
}
// if this is a synchronous transaction, wait for it to take effect before if (transactionFlags) {
// returning. // this triggers the transaction
if (flags & eSynchronous) { setTransactionFlags(transactionFlags);
mTransationPending = true;
} // if this is a synchronous transaction, wait for it to take effect
while (mTransationPending) { // before returning.
status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); if (flags & eSynchronous) {
if (CC_UNLIKELY(err != NO_ERROR)) { mTransationPending = true;
// just in case something goes wrong in SF, return to the }
// called after a few seconds. while (mTransationPending) {
LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!"); status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5));
mTransationPending = false; if (CC_UNLIKELY(err != NO_ERROR)) {
break; // just in case something goes wrong in SF, return to the
// called after a few seconds.
LOGW_IF(err == TIMED_OUT, "closeGlobalTransaction timed out!");
mTransationPending = false;
break;
}
} }
} }
} }