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

Commit 07da476b authored by Mike Yu's avatar Mike Yu Committed by android-build-merger
Browse files

Convert to use libbase ScopedLockAssertion am: 411ea7f2

am: f86604a3

Change-Id: I8140c3d3717aed59b979e68651f37f4130cbd7d2
parents 33f462aa f86604a3
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -902,14 +902,6 @@ struct resolv_cache_info {
    std::unordered_map<int, uint32_t> dns_event_subsampling_map;
};

// A helper class for the Clang Thread Safety Analysis to deal with
// std::unique_lock.
class SCOPED_CAPABILITY ScopedAssumeLocked {
  public:
    explicit ScopedAssumeLocked(std::mutex& mutex) ACQUIRE(mutex) {}
    ~ScopedAssumeLocked() RELEASE() {}
};

// lock protecting everything in the resolve_cache_info structs (next ptr, etc)
static std::mutex cache_mutex;
static std::condition_variable cv;
@@ -1175,7 +1167,7 @@ ResolvCacheStatus resolv_cache_lookup(unsigned netid, const void* query, int que
    }
    /* lookup cache */
    std::unique_lock lock(cache_mutex);
    ScopedAssumeLocked assume_lock(cache_mutex);
    android::base::ScopedLockAssertion assume_lock(cache_mutex);
    cache = find_named_cache_locked(netid);
    if (cache == nullptr) {
        return RESOLV_CACHE_UNSUPPORTED;