diff options
| author | 2011-11-09 14:36:11 +0000 | |
|---|---|---|
| committer | 2011-11-09 14:36:11 +0000 | |
| commit | 312f6c76eb575a773c4d611cd3bdffbbe21fdb28 (patch) | |
| tree | f71d89207d5dab4574ea0002b0441047761b1679 | |
| parent | 72f7fbeac3f4748d75d3c9ff75864c77ea550b3a (diff) | |
| parent | 0fe35d093bc937418e90004ce66cd2e87a578aa6 (diff) | |
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
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 8f4fdb8fed..1b00e9380a 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -1217,23 +1217,25 @@ void SurfaceFlinger::setTransactionState(const Vector<ComposerState>& state, sp<Client> client( static_cast<Client *>(s.client.get()) ); transactionFlags |= setClientStateLocked(client, s.state); } + if (transactionFlags) { + // this triggers the transaction setTransactionFlags(transactionFlags); - } - // if this is a synchronous transaction, wait for it to take effect before - // returning. - if (flags & eSynchronous) { - mTransationPending = true; - } - while (mTransationPending) { - status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); - if (CC_UNLIKELY(err != NO_ERROR)) { - // 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; + // if this is a synchronous transaction, wait for it to take effect + // before returning. + if (flags & eSynchronous) { + mTransationPending = true; + } + while (mTransationPending) { + status_t err = mTransactionCV.waitRelative(mStateLock, s2ns(5)); + if (CC_UNLIKELY(err != NO_ERROR)) { + // 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; + } } } } |