public static void Add(IGenericArrayPoolCaches arrayPoolCache) { lock (_arrayPoolCaches) { _arrayPoolCaches.Add(arrayPoolCache); } }
public void GlobalSetup() { _arrayPool = ArrayPool <byte> .Shared; DIBuilder.New().AddLogging() .Add(x => x.AddSingleton <IGenericArrayPoolCaches <byte> >(new GenericArrayPoolCaches <byte>())).Build() .Complete(); _genericArrayPoolIntf = GenericArrayPoolCacheHelper <byte> .Caches(); _genericArrayPoolObj = GenericArrayPoolCacheHelper <byte> .Caches() as GenericArrayPoolCaches <byte>; }
public static IGenericArrayPoolCaches <T> Caches() { if (_caches == null) { lock (lockObj) { if (_caches == null) { _caches = new GenericArrayPoolCaches <T>(); GenericArrayPoolCachesRegister.Add(_caches); } } } return(_caches); }
public static void Clear() { _caches = null; }