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; }
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]); } }