From 45d8cf942f08caf7f6a4b1057d46adb96c28b66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=8F=8B=E6=9D=BE?= Date: Thu, 3 Apr 2025 00:58:48 +0000 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=94=81=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邹友松 --- services/engine/src/update_service.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/engine/src/update_service.cpp b/services/engine/src/update_service.cpp index f91093c3..43a380fc 100644 --- a/services/engine/src/update_service.cpp +++ b/services/engine/src/update_service.cpp @@ -142,11 +142,11 @@ int32_t UpdateService::RegisterUpdateCallback(const UpgradeInfo &info, const spt ClientProxy clientProxy(info, updateCallback); clientProxy.AddDeathRecipient(); clientProxyMap_.insert({info, clientProxy}); + DelayedSingleton::GetInstance()->SetRemoteIdle(clientProxyMap_.empty()); } if (!info.IsLocal()) { UpdateServiceCache::SetUpgradeInfo(info); } - DelayedSingleton::GetInstance()->SetRemoteIdle(clientProxyMap_.empty()); return INT_CALL_SUCCESS; } @@ -424,6 +424,7 @@ void BuildTaskInfoDump(const int fd) void UpdateService::DumpUpgradeCallback(const int fd) { dprintf(fd, "---------------------callback info--------------------\n"); + std::lock_guard lock(clientProxyMapLock_); for (const auto &iter : clientProxyMap_) { const UpgradeInfo& info = iter.first; dprintf(fd, "%s\n", info.ToString().c_str()); -- Gitee