diff --git a/services/key_enable/utils/src/local_code_sign_utils.cpp b/services/key_enable/utils/src/local_code_sign_utils.cpp index df2c32902de15a0b9ed0a482536ff4586dfc5ee1..292950da9d9fd2c56d1ca36dd94a4c2f5bd2070a 100644 --- a/services/key_enable/utils/src/local_code_sign_utils.cpp +++ b/services/key_enable/utils/src/local_code_sign_utils.cpp @@ -57,11 +57,14 @@ protected: do { ret = LocalCodeSignKit::InitLocalCertificate(cert); usleep(INIT_LOCAL_CERT_SLEEP_US); - } while (ret == CS_ERR_SA_GET_PROXY); + } while (ret == CS_ERR_SA_GET_PROXY && !ShouldExit()); success = (ret == CS_SUCCESS); g_condition.notify_one(); return true; } + bool ShouldExit() { + return this->IsExitPending(); + } private: bool success = false; ByteBuffer cert; @@ -93,5 +96,6 @@ int32_t InitLocalCertificate(uint8_t *certData, uint32_t *certSize) } *certSize = cert.GetSize(); + thread->NotifyExitAsync(); return CS_SUCCESS; } \ No newline at end of file