Exemple #1
0
        internal void Init(int capacity)
        {
            int c = QueueHelper.RoundPowerOf2(capacity);

            array = new Slot[c + 2];
            mask  = c - 1;
        }
Exemple #2
0
        internal void InitVolatile(int capacity)
        {
            int c = QueueHelper.RoundPowerOf2(capacity);

            mask = c - 1;
            Volatile.Write(ref array, new Slot[c + 2]);
        }
        internal void Init(int capacity)
        {
            int c = QueueHelper.RoundPowerOf2(Math.Max(2, capacity));

            producerArray = consumerArray = new Slot[c + 2];
            mask          = c - 1;
        }
        internal void InitVolatile(int capacity)
        {
            int c = QueueHelper.RoundPowerOf2(Math.Max(2, capacity));

            Slot[] a = new Slot[c + 2];
            mask          = c - 1;
            producerArray = a;
            Volatile.Write(ref consumerArray, a);
        }
Exemple #5
0
 internal bool IsEmpty()
 {
     return(QueueHelper.IsEmpty(ref producerIndex, ref consumerIndex));
 }
Exemple #6
0
 internal int Size()
 {
     return(QueueHelper.Size(ref producerIndex, ref consumerIndex));
 }
Exemple #7
0
 public void Clear()
 {
     QueueHelper.Clear(this);
 }