Пример #1
0
 public static void Add(IGenericArrayPoolCaches arrayPoolCache)
 {
     lock (_arrayPoolCaches)
     {
         _arrayPoolCaches.Add(arrayPoolCache);
     }
 }
Пример #2
0
            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>;
            }
Пример #3
0
        public static IGenericArrayPoolCaches <T> Caches()
        {
            if (_caches == null)
            {
                lock (lockObj)
                {
                    if (_caches == null)
                    {
                        _caches = new GenericArrayPoolCaches <T>();
                        GenericArrayPoolCachesRegister.Add(_caches);
                    }
                }
            }

            return(_caches);
        }
Пример #4
0
 public static void Clear()
 {
     _caches = null;
 }