Commit 81da2ab
committed
Error fix from enabling Clang thread-safety checks.
Parent bug: b/353324127. Enabling `thread-safety-reference-return`
to allow developers to utilize Clang thread safety guardrails
(GUARDED_BY, REQUIRES, EXCLUDES).
Error:
frameworks/native/services/surfaceflinger/Scheduler/RefreshRateSelector.h:307:55:
error: returning variable 'mDisplayModes' by reference requires holding
mutex 'mLock' [-Werror,-Wthread-safety-reference-return]
Fix: return by value, hold mutex from parent, or remove GUARDED_BY
attribute.
This fix removes the GUARDED_BY attribute in order to avoid changing
functionality. If this is not desired, please respond with concerns
or preferred fix.
Change-Id: Ia3444fd193294e1478a9f830651eb8dabf2c73cd
Bug: 354740314
Test: make1 parent a42f727 commit 81da2ab
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
308 | 311 | | |
309 | 312 | | |
310 | 313 | | |
| |||
0 commit comments