From d22ec2e626b975fc96310eb2d1e2a9f8b6130cd4 Mon Sep 17 00:00:00 2001 From: panyongchaox Date: Thu, 18 Jun 2026 12:10:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=AD=BB=E9=94=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: panyongchaox Change-Id: I7136914c8f82324293314c30b30bc72e657a4e21 --- .../security_component/src/sec_comp_client.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frameworks/inner_api/security_component/src/sec_comp_client.cpp b/frameworks/inner_api/security_component/src/sec_comp_client.cpp index 085a56a..f29894f 100644 --- a/frameworks/inner_api/security_component/src/sec_comp_client.cpp +++ b/frameworks/inner_api/security_component/src/sec_comp_client.cpp @@ -143,10 +143,12 @@ int32_t SecCompClient::RegisterSecurityComponent(SecCompType type, if (std::find(RETRY_CODE_LIST.begin(), RETRY_CODE_LIST.end(), res) == RETRY_CODE_LIST.end()) { return res; } - - std::unique_lock lock(secCompSaMutex_); - auto waitStatus = secCompSACon_.wait_for(lock, std::chrono::milliseconds(SA_DIED_TIME_OUT), - [this]() { return serviceAbilityNeedLoadFlag_; }); + bool waitStatus = false; + { + std::unique_lock lock(secCompSaMutex_); + waitStatus = secCompSACon_.wait_for(lock, std::chrono::milliseconds(SA_DIED_TIME_OUT), + [this]() { return serviceAbilityNeedLoadFlag_; }); + } if (waitStatus) { proxy = GetProxy(true); if (proxy != nullptr) {