summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/SurfaceFlinger.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-05-03 17:04:02 -0700
committerMathias Agopian <mathias@google.com>2011-05-03 20:44:51 -0700
commitdea20b1f343012d58ca9eb381684b26a168dc127 (patch)
tree6fa9206a9b1028672f44ec63fb27853b20b083eb /services/surfaceflinger/SurfaceFlinger.h
parent33e85420b1796898d9aa5e7df75de97c34717744 (diff)
downloadframeworks_native-dea20b1f343012d58ca9eb381684b26a168dc127.zip
frameworks_native-dea20b1f343012d58ca9eb381684b26a168dc127.tar.gz
frameworks_native-dea20b1f343012d58ca9eb381684b26a168dc127.tar.bz2
Fix a race in SurfaceFlinger that could cause layers to be leaked forever.
The transaction flags were atomically read-and-cleared to determine if a transaction was needed, in the later case, mStateLock was taken to keep the current state still during the transaction. This left a small window open, where a layer could be removed after the transaction flags were checked but before the transaction was started holding the lock. In that situation eTraversalNeeded would be set but only seen during the next transaction cycle; however, because we're handling this transaction (because of another flag) it will be commited, "loosing" the information about the layer being removed -- so when the next transaction cycle due to eTraversalNeeded starts, it won't notice that layers have been removed and won't populated the ditchedLayers array. Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.h')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 3eb4c11..1e16943 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -325,6 +325,7 @@ private:
status_t purgatorizeLayer_l(const sp<LayerBase>& layer);
uint32_t getTransactionFlags(uint32_t flags);
+ uint32_t peekTransactionFlags(uint32_t flags);
uint32_t setTransactionFlags(uint32_t flags);
void commitTransaction();