Content deleted Content added
No edit summary |
→C#: Cleaned up to remove lock by using a ConcurrentDictionary |
||
Line 70:
<source lang=CSharp>
using System.Collections.Generic;
using System.Collections.Concurrent;
namespace MyApplication
{ class FooMultiton
private static readonly
private FooMultiton() {}
▲ }
public static FooMultiton GetInstance(object key)
_instances.TryAdd(key,
return
}
}
|