From 8b53d8e921683b26447c439a0c92fd6263ab477a Mon Sep 17 00:00:00 2001 From: hsc Date: Mon, 14 Sep 2026 13:48:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20GlobalInfo=E5=9B=9B=E4=B8=AA=E4=BD=9C?= =?UTF-8?q?=E7=94=A8=E5=9F=9F=E5=AD=97=E5=85=B8=E6=94=B9=E4=B8=BAConcurren?= =?UTF-8?q?tDictionary=E6=8F=90=E5=8D=87=E7=BA=BF=E7=A8=8B=E5=AE=89?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UIShare/GlobalVariable/GlobalInfo.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/UIShare/GlobalVariable/GlobalInfo.cs b/UIShare/GlobalVariable/GlobalInfo.cs index 305e81e..690163e 100644 --- a/UIShare/GlobalVariable/GlobalInfo.cs +++ b/UIShare/GlobalVariable/GlobalInfo.cs @@ -12,10 +12,14 @@ namespace UIShare.GlobalVariable public class GlobalInfo:BindableBase { public event EventHandler? ScopeChanged; - public Dictionary ContextDic { get; set; } - public Dictionary StepRunningDic { get; set; } - public Dictionary ConfigDic { get; set; } - public Dictionary ScopeDic { get; set; } + /// 作用域名 → 作用域上下文(线程安全:可能被多个作用域并发创建/销毁) + public ConcurrentDictionary ContextDic { get; set; } + /// 作用域名 → 测试运行器(线程安全:可能被多个作用域并发创建/销毁) + public ConcurrentDictionary StepRunningDic { get; set; } + /// 作用域名 → 系统配置(线程安全:可能被多个作用域并发创建/销毁) + public ConcurrentDictionary ConfigDic { get; set; } + /// 作用域名 → 作用域容器(线程安全:可能被多个作用域并发创建/销毁) + public ConcurrentDictionary ScopeDic { get; set; } /// 硬件指纹 → 设备实例的并发池,确保同一物理硬件全局只创建一个驱动实例。 public ConcurrentDictionary> HardwarePool { get; set; }