diff options
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.h')
-rw-r--r-- | services/surfaceflinger/RegionSamplingThread.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.h b/services/surfaceflinger/RegionSamplingThread.h index 72b20420ef..08134e6acd 100644 --- a/services/surfaceflinger/RegionSamplingThread.h +++ b/services/surfaceflinger/RegionSamplingThread.h @@ -100,7 +100,7 @@ private: void binderDied(const wp<IBinder>& who) override; void checkForStaleLuma(); - void captureSample() REQUIRES(mMutex); + void captureSample(); void threadMain(); SurfaceFlinger& mFlinger; @@ -110,19 +110,18 @@ private: std::unique_ptr<SamplingOffsetCallback> const mPhaseCallback; - std::mutex mThreadMutex; - std::thread mThread GUARDED_BY(mThreadMutex); + std::thread mThread; - std::mutex mMutex; + std::mutex mThreadControlMutex; std::condition_variable_any mCondition; - bool mRunning GUARDED_BY(mMutex) = true; - bool mSampleRequested GUARDED_BY(mMutex) = false; - - std::unordered_map<wp<IBinder>, Descriptor, WpHash> mDescriptors GUARDED_BY(mMutex); - std::chrono::nanoseconds lastSampleTime GUARDED_BY(mMutex); - bool mDiscardedFrames GUARDED_BY(mMutex) = false; - - sp<GraphicBuffer> mCachedBuffer GUARDED_BY(mMutex) = nullptr; + bool mRunning GUARDED_BY(mThreadControlMutex) = true; + bool mSampleRequested GUARDED_BY(mThreadControlMutex) = false; + bool mDiscardedFrames GUARDED_BY(mThreadControlMutex) = false; + std::chrono::nanoseconds lastSampleTime GUARDED_BY(mThreadControlMutex); + + std::mutex mSamplingMutex; + std::unordered_map<wp<IBinder>, Descriptor, WpHash> mDescriptors GUARDED_BY(mSamplingMutex); + sp<GraphicBuffer> mCachedBuffer GUARDED_BY(mSamplingMutex) = nullptr; }; } // namespace android |