Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ac078263 authored by Liz Prucka's avatar Liz Prucka
Browse files

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).

Errors:

frameworks/av/services/audioflinger/Threads.h:383:16: error:
returning variable 'mOutDeviceTypeAddrs' by reference requires
holding mutex 'ThreadBase_Mutex' [-Werror,-Wthread-safety-reference-return]

frameworks/av/services/audioflinger/Threads.h:386:16: error:
returning variable 'mInDeviceTypeAddr' by reference requires
holding mutex 'ThreadBase_Mutex' [-Werror,-Wthread-safety-reference-return]

Fix: return by value, add REQUIRES attribute to each function, or
remove GUARDED_BY attribute.

This fix adds REQUIRES to outDeviceTypeAddrs() and inDeviceTypeAddr()
functions. If this is not desired, please respond with concerns
or preferred fix.

Change-Id: I599ca55e2d8a0794fca4ee4371e155fe408ec037
Bug: 353326415
Test: make
parent b4bc04d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment