summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-07 21:58:03 -0800
committerMathias Agopian <mathias@google.com>2011-11-07 21:58:03 -0800
commita06c06b9c079f98538cfbd1c06123383a0e38e32 (patch)
treed4208de7814c974ace15cc66462dab9a1650ca60 /services/surfaceflinger
parent7f1c94e198e051bf481fd2d286c7b33d00664f9d (diff)
downloadframeworks_base-a06c06b9c079f98538cfbd1c06123383a0e38e32.zip
frameworks_base-a06c06b9c079f98538cfbd1c06123383a0e38e32.tar.gz
frameworks_base-a06c06b9c079f98538cfbd1c06123383a0e38e32.tar.bz2
Fix an issue where we could wait for a non-existing transaction
This fixes the issue: "Call not sent" dialog takes too long to dismiss after hitting OK" Note: the system would recover after a 5 second timeout. Bug: 5534520 Change-Id: Ifa37e594b50581f498479a5858672441b3d7dd87
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 8f4fdb8..1b00e93 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;
+ }
}
}
}