diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-08 20:02:47 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-08 22:48:24 -0700 |
commit | 4d2de2c7696feccb9e5ecc05ac3281cdaae45418 (patch) | |
tree | 23274847d49bf4581786e0e37ba845eaaf78f38d /libs/surfaceflinger/LayerBuffer.h | |
parent | e40e5507007b15035b81811a5cc2298572e732a2 (diff) | |
download | frameworks_native-4d2de2c7696feccb9e5ecc05ac3281cdaae45418.zip frameworks_native-4d2de2c7696feccb9e5ecc05ac3281cdaae45418.tar.gz frameworks_native-4d2de2c7696feccb9e5ecc05ac3281cdaae45418.tar.bz2 |
rename Mutexes to make the code easier to follow
Diffstat (limited to 'libs/surfaceflinger/LayerBuffer.h')
-rw-r--r-- | libs/surfaceflinger/LayerBuffer.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/libs/surfaceflinger/LayerBuffer.h b/libs/surfaceflinger/LayerBuffer.h index e539f68..3b09998 100644 --- a/libs/surfaceflinger/LayerBuffer.h +++ b/libs/surfaceflinger/LayerBuffer.h @@ -124,7 +124,7 @@ private: virtual void unregisterBuffers(); virtual bool transformed() const; private: - mutable Mutex mLock; + mutable Mutex mBufferSourceLock; sp<Buffer> mBuffer; status_t mStatus; ISurface::BufferHeap mBufferHeap; @@ -145,14 +145,18 @@ private: virtual void onVisibilityResolved(const Transform& planeTransform); private: void serverDestroy(); - void destroyOverlay(); + void destroyOverlay(); + class OverlayChannel : public BnOverlay { - mutable Mutex mLock; - sp<OverlaySource> mSource; + public: + OverlayChannel(const sp<OverlaySource>& source) + : mSource(source) { + } + private: virtual void destroy() { sp<OverlaySource> source; { // scope for the lock; - Mutex::Autolock _l(mLock); + Mutex::Autolock _l(mDestroyLock); source = mSource; mSource.clear(); } @@ -160,11 +164,10 @@ private: source->serverDestroy(); } } - public: - OverlayChannel(const sp<OverlaySource>& source) - : mSource(source) { - } + mutable Mutex mDestroyLock; + sp<OverlaySource> mSource; }; + friend class OverlayChannel; bool mVisibilityChanged; @@ -176,7 +179,7 @@ private: int32_t mFormat; int32_t mWidthStride; int32_t mHeightStride; - mutable Mutex mLock; + mutable Mutex mOverlaySourceLock; bool mInitialized; }; @@ -199,7 +202,7 @@ private: return static_cast<LayerBuffer*>(Surface::getOwner().get()); } }; - + mutable Mutex mLock; sp<Source> mSource; sp<Surface> mSurface; |