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

Commit fac05be5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add [[clang::no_destroy]] to static global vars that could be used in...

Merge "Add [[clang::no_destroy]] to static global vars that could be used in onBinderDied" into main
parents a67d5191 0c6f5aa6
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -62,9 +62,9 @@ static struct {
jfloat gUndefinedTemperature;

static void getThermalHalLocked();
static std::mutex gThermalHalMutex;
static sp<hardware::thermal::V1_0::IThermal> gThermalHidlHal = nullptr;
static std::shared_ptr<IThermal> gThermalAidlHal = nullptr;
[[clang::no_destroy]] static std::mutex gThermalHalMutex;
[[clang::no_destroy]] static sp<hardware::thermal::V1_0::IThermal> gThermalHidlHal = nullptr;
[[clang::no_destroy]] static std::shared_ptr<IThermal> gThermalAidlHal = nullptr;

struct ThermalHidlHalDeathRecipient : virtual public hidl_death_recipient {
    // hidl_death_recipient interface
@@ -83,8 +83,9 @@ static void onThermalAidlBinderDied(void *cookie) {
    getThermalHalLocked();
}

sp<ThermalHidlHalDeathRecipient> gThermalHidlHalDeathRecipient = nullptr;
ndk::ScopedAIBinder_DeathRecipient gThermalAidlDeathRecipient;
[[clang::no_destroy]] static sp<ThermalHidlHalDeathRecipient> gThermalHidlHalDeathRecipient =
        nullptr;
[[clang::no_destroy]] static ndk::ScopedAIBinder_DeathRecipient gThermalAidlDeathRecipient;

// ----------------------------------------------------------------------------