Exemplo n.º 1
0
        public T ReadValue(IValueReader valueReader)
        {
            if (valueReader is ISingleThreadOptimize)
            {
                var current_cache = thread_cache;

                if (current_cache == null)
                {
                    current_cache = new InternalInstance <ArrayRW <T> >
                    {
                        Instance = ArrayRW <T> .Create()
                    };

                    thread_cache = current_cache;
                }

                if (current_cache.IsUsed)
                {
                    goto Default;
                }

                current_cache.IsUsed = true;

                current_cache.Instance.count = -1;

                valueReader.ReadArray(current_cache.Instance);

                current_cache.IsUsed = false;

                if (current_cache.Instance.count == -1)
                {
                    return(default);
Exemplo n.º 2
0
        public void InitializeInstance(ref InternalInstance <FastObjectRW <T> > current_cache)
        {
            current_cache = new InternalInstance <FastObjectRW <T> >
            {
                Instance = FastObjectRW <T> .Create()
            };

            thread_cache = current_cache;
        }