internal InternalPartitionEnumerator(IEnumerator <TSource> sharedReader, Partitioner.SharedLong sharedIndex, Partitioner.SharedBool hasNoElementsLeft, object sharedLock, Partitioner.SharedInt activePartitionCount, Partitioner.DynamicPartitionerForIEnumerable <TSource> .InternalPartitionEnumerable enumerable, bool useSingleChunking) : base(sharedReader, sharedIndex, useSingleChunking) { this.m_hasNoElementsLeft = hasNoElementsLeft; this.m_sharedLock = sharedLock; this.m_enumerable = enumerable; this.m_activePartitionCount = activePartitionCount; if (this.m_activePartitionCount == null) { return; } Interlocked.Increment(ref this.m_activePartitionCount.Value); }
internal InternalPartitionEnumerable(IEnumerator <TSource> sharedReader, bool useSingleChunking, bool isStaticPartitioning) { this.m_sharedReader = sharedReader; this.m_sharedIndex = new Partitioner.SharedLong(-1L); this.m_hasNoElementsLeft = new Partitioner.SharedBool(false); this.m_sourceDepleted = new Partitioner.SharedBool(false); this.m_sharedLock = new object(); this.m_useSingleChunking = useSingleChunking; if (!this.m_useSingleChunking) { this.m_FillBuffer = new KeyValuePair <long, TSource> [(PlatformHelper.ProcessorCount > 4 ? 4: 1) * Partitioner.GetDefaultChunkSize <TSource>()]; } if (isStaticPartitioning) { this.m_activePartitionCount = new Partitioner.SharedInt(0); } else { this.m_activePartitionCount = (Partitioner.SharedInt)null; } }