From ff2628071d911e740cde2d6e9757efd22c4292dc Mon Sep 17 00:00:00 2001 From: hai007 Date: Mon, 1 Mar 2021 20:30:44 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 360339328 --- cpp/core/internal/client_proxy.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/core/internal/client_proxy.cc b/cpp/core/internal/client_proxy.cc index c901d404..a4551c44 100644 --- a/cpp/core/internal/client_proxy.cc +++ b/cpp/core/internal/client_proxy.cc @@ -679,7 +679,10 @@ void ClientProxy::ScheduleClearLocalHighVisModeCacheEndpointIdAlarm() { this, local_high_vis_mode_cache_endpoint_id_.c_str()); clear_local_high_vis_mode_cache_endpoint_id_alarm_ = CancelableAlarm( "clear_high_power_endpoint_id_cache", - [this]() { local_high_vis_mode_cache_endpoint_id_.clear(); }, + [this]() { + MutexLock lock(&mutex_); + local_high_vis_mode_cache_endpoint_id_.clear(); + }, kHighPowerAdvertisementEndpointIdCacheTimeout, &single_thread_executor_); }