From 91817e8430d82d346b5fe3760037a26aecbd89f1 Mon Sep 17 00:00:00 2001 From: xionglei Date: Tue, 3 Sep 2024 12:29:20 +0000 Subject: [PATCH] update wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp. Signed-off-by: xionglei --- .../wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp index 7d84e088d..feb5eb845 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta_sa/wifi_device_mgr_service_impl.cpp @@ -26,10 +26,10 @@ DEFINE_WIFILOG_HOTSPOT_LABEL("WifiDeviceMgrServiceImpl"); namespace OHOS { namespace Wifi { - const std::string EXTENSION_BACKUP = "backup"; const std::string EXTENSION_RESTORE = "restore"; std::mutex WifiDeviceMgrServiceImpl::g_instanceLock; +std::mutex WifiDeviceMgrServiceImpl::g_initMutex; sptr WifiDeviceMgrServiceImpl::g_instance; const bool REGISTER_RESULT = SystemAbility::MakeAndRegisterAbility( WifiDeviceMgrServiceImpl::GetInstance().GetRefPtr()); @@ -85,6 +85,7 @@ void WifiDeviceMgrServiceImpl::OnStop() bool WifiDeviceMgrServiceImpl::Init() { + std::lock_guard lock(g_initMutex); if (!mPublishFlag) { for (int i = 0; i < STA_INSTANCE_MAX_NUM; i++) { sptr wifi = new WifiDeviceServiceImpl(i);