From 5ad959bb482a5cc93aeca751f225820846aac37b Mon Sep 17 00:00:00 2001 From: essence-of-the-soul Date: Wed, 5 Aug 2026 11:08:46 +0000 Subject: [PATCH] =?UTF-8?q?fix(#IK2CMT):=20=E7=A7=BB=E9=99=A4=20upgrader.a?= =?UTF-8?q?tomicFlag=20=E6=AD=BB=E4=BB=A3=E7=A0=81=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 issue #IK2CMT --- internal/upgrade/upgrader.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/internal/upgrade/upgrader.go b/internal/upgrade/upgrader.go index 7f213ba..d818fe6 100644 --- a/internal/upgrade/upgrader.go +++ b/internal/upgrade/upgrader.go @@ -13,7 +13,6 @@ import ( "io" "os" "path/filepath" - "sync" "sync/atomic" "time" @@ -330,26 +329,3 @@ func UnmarshalReport(b []byte) (Report, error) { } return r, nil } - -// atomicFlag 是对 sync.Mutex 的极小封装,与 task-manager 端"同时只 -// 允许一个部署"的模式保持对称。导出以备 Stage 5 的文件拉取升级器复用。 -type atomicFlag struct { - mu sync.Mutex - on bool -} - -func (a *atomicFlag) tryLock() bool { - a.mu.Lock() - defer a.mu.Unlock() - if a.on { - return false - } - a.on = true - return true -} - -func (a *atomicFlag) unlock() { - a.mu.Lock() - a.on = false - a.mu.Unlock() -} -- Gitee