From 3e60efd5f52d8d4eddece447834fb2cbb71fc58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B3=BB=E6=9C=8B?= Date: Thu, 14 Nov 2024 06:48:48 +0000 Subject: [PATCH] =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=9A=84=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/sim/include/sim_state_manager.h | 6 +++--- services/sim/src/sim_state_manager.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/services/sim/include/sim_state_manager.h b/services/sim/include/sim_state_manager.h index fd8c47800..b53ed23d0 100644 --- a/services/sim/include/sim_state_manager.h +++ b/services/sim/include/sim_state_manager.h @@ -69,11 +69,11 @@ public: bool responseSimUnlockPinReady_ = false; std::mutex ctx_; std::mutex stx_; - std::mutex rtx_; + std::mutex UnlockPin_ctx_; std::condition_variable cv_; std::condition_variable sv_; - std::condition_variable rv_; - + std::condition_variable UnlockPin_cv_; + private: void RequestUnlock(UnlockCmd type); diff --git a/services/sim/src/sim_state_manager.cpp b/services/sim/src/sim_state_manager.cpp index 45b274d8b..2af756abf 100644 --- a/services/sim/src/sim_state_manager.cpp +++ b/services/sim/src/sim_state_manager.cpp @@ -175,11 +175,11 @@ void SimStateManager::SyncSimMatchResponse() void SimStateManager::SyncSimUnlockPinResponse() { - std::unique_lock lck(rtx_); + std::unique_lock lck(UnlockPin_ctx_); responseSimUnlockPinReady_ = true; TELEPHONY_LOGI( "SimStateManager::SyncSimUnlockPinResponse(), responsSimUnlockPinReady = %{public}d", responseSimUnlockPinReady_); - rv_.notify_one(); + UnlockPin_cv_.notify_one(); } int32_t SimStateManager::UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response) @@ -188,13 +188,13 @@ int32_t SimStateManager::UnlockPin(int32_t slotId, const std::string &pin, LockS TELEPHONY_LOGE("simStateHandle_ is nullptr"); return TELEPHONY_ERR_LOCAL_PTR_NULL; } - std::unique_lock lck(rtx_); + std::unique_lock lck(UnlockPin_ctx_); TELEPHONY_LOGD("SimStateManager::UnlockPin slotId = %{public}d", slotId); responseSimUnlockPinReady_ = false; simStateHandle_->UnlockPin(slotId, pin); while (!responseSimUnlockPinReady_) { TELEPHONY_LOGI("UnlockPin::wait(), response = false"); - if (rv_.wait_for(lck, std::chrono::seconds(WAIT_TIME_LONG_SECOND)) == std::cv_status::timeout) { + if (UnlockPin_cv_.wait_for(lck, std::chrono::seconds(WAIT_TIME_LONG_SECOND)) == std::cv_status::timeout) { break; } }