From 53d2822d7e17488844125c3c460b385266596431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Tue, 13 May 2025 15:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BAsessison=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E7=AD=89=E5=BE=85=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- services/implementation/src/device_manager_service_impl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/implementation/src/device_manager_service_impl.cpp b/services/implementation/src/device_manager_service_impl.cpp index 8bc029e69..fe6fe34d0 100644 --- a/services/implementation/src/device_manager_service_impl.cpp +++ b/services/implementation/src/device_manager_service_impl.cpp @@ -68,6 +68,7 @@ constexpr const char* CHANGE_PINTYPE = "1"; // currently, we just support one bind session in one device at same time constexpr size_t MAX_NEW_PROC_SESSION_COUNT_TEMP = 1; const int32_t USLEEP_TIME_US_500000 = 500000; // 500ms +const int32_t OPEN_AUTH_SESSION_TIMEOUT = 15000; // 15000ms const std::map BUNDLENAME_MAPPING = { { "wear_link_service", "watch_system_service" } @@ -1496,7 +1497,7 @@ std::shared_ptr DeviceManagerServiceImpl::GetOrCreateSession(const std: } std::unique_lock cvLock(sessionEnableMutexMap_[sessionId]); - if (sessionEnableCvMap_[sessionId].wait_for(cvLock, std::chrono::milliseconds(EVENT_TIMEOUT), + if (sessionEnableCvMap_[sessionId].wait_for(cvLock, std::chrono::milliseconds(OPEN_AUTH_SESSION_TIMEOUT), [&] { return sessionEnableCvReadyMap_[sessionId]; })) { LOGI("session enable, sessionId: %{public}d.", sessionId); } else { -- Gitee