From c40abca839dfe4c952d700b8a9d3a398f2f20822 Mon Sep 17 00:00:00 2001 From: hanlin15 Date: Mon, 11 Aug 2025 06:41:29 +0000 Subject: [PATCH] update ipc/native/src/core/framework/source/ipc_process_skeleton.cpp. Test Signed-off-by: hanlin15 --- .../core/framework/source/ipc_process_skeleton.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ipc/native/src/core/framework/source/ipc_process_skeleton.cpp b/ipc/native/src/core/framework/source/ipc_process_skeleton.cpp index fe127021..24258e81 100644 --- a/ipc/native/src/core/framework/source/ipc_process_skeleton.cpp +++ b/ipc/native/src/core/framework/source/ipc_process_skeleton.cpp @@ -421,6 +421,9 @@ void IPCProcessSkeleton::BlockUntilThreadAvailable() if (numExecuting_ > maxIPCThreadNum) { ZLOGE(LOG_LABEL, "numExecuting_++ is %{public}d", numExecuting_); } + if (threadPool_== nullptr) { + return; + } while (numExecuting_ >= threadPool_->GetMaxThreadNum()) { cv_.wait(lock); } @@ -433,7 +436,9 @@ void IPCProcessSkeleton::LockForNumExecuting() CHECK_INSTANCE_EXIT(exitFlag_); std::lock_guard lockGuard(mutex_); numExecuting_++; - + if (threadPool_== nullptr) { + return; + } if (numExecuting_ == threadPool_->GetMaxThreadNum()) { uint64_t curTime = static_cast(std::chrono::duration_cast( std::chrono::steady_clock::now().time_since_epoch()).count()); @@ -447,7 +452,9 @@ void IPCProcessSkeleton::UnlockForNumExecuting() { CHECK_INSTANCE_EXIT(exitFlag_); std::lock_guard lockGuard(mutex_); - + if (threadPool_== nullptr) { + return; + } if (numExecuting_ == threadPool_->GetMaxThreadNum()) { uint64_t curTime = static_cast(std::chrono::duration_cast( std::chrono::steady_clock::now().time_since_epoch()).count()); -- Gitee