예제 #1
0
        public void Initialize(int consumerCount)
        {
            blockSource.InitializeBlock(out circBuffer.Buffer[(circBuffer.ProducerPosition - 1) & (circBuffer.BlockCount - 1)]);

            circBuffer.Initialize(consumerCount);
            tRefiller = new Thread(Filler);

            //BufferUnderrunCount = 0;
            isEndOfStream = false;
        }
예제 #2
0
        public RefillBuffer(ICircularBuffer <T> circBuffer, IBlockSource <T> blockSource)
        {
            this.circBuffer  = circBuffer;
            this.blockSource = blockSource;

            for (int i = 0; i < circBuffer.Buffer.Length; i++)
            {
                blockSource.InitializeBlock(out circBuffer.Buffer[i]);
            }
        }