This commit is contained in:
snltty
2024-08-29 15:02:12 +08:00
parent ce1dc9d669
commit 688c758b5a
13 changed files with 98 additions and 22 deletions

View File

@@ -21,6 +21,7 @@ namespace linker.libs
public sealed class OperatingMultipleManager
{
private readonly ConcurrentDictionary<string, bool> dicOperating = new ConcurrentDictionary<string, bool>();
private readonly ConcurrentDictionary<uint, bool> dicOperating1 = new ConcurrentDictionary<uint, bool>();
public bool StartOperation(string key)
{
@@ -31,5 +32,13 @@ namespace linker.libs
dicOperating.TryRemove(key, out _);
}
public bool StartOperation(uint key)
{
return dicOperating1.TryAdd(key, true);
}
public void StopOperation(uint key)
{
dicOperating1.TryRemove(key, out _);
}
}
}