Beispiel #1
0
        public virtual LongIntComboListEnumerator[] GetEnumerators()
        {
            if (!didopen)
            {
                throw new Exception("Attempted to GetEnumerators before Open");
            }

            LongIntComboListEnumerator[] results;
            lock (dslaves)
            {
                byte enumid = nextenumid;
                if (nextenumid >= 32)
                {
                    nextenumid = 0;
                }
                else
                {
                    nextenumid++;
                }

                int i;
                results = new LongIntComboListEnumerator[dslaves.Count];

                i = 0;
                foreach (SlaveInfo _slave in dslaves)
                {
                    BufSlaveInfo slave = (BufSlaveInfo)_slave;
                    if (addbufinitsize > 0)
                    {
                        lock (slave)
                        {
                            slave.FlushAddBuf_unlocked();
                        }
                    }
                    results[i]     = new LongIntComboListEnumerator(slave, enumid);
                    results[i].buf = this.buf; // Not needed, but fine.
                    i++;
                }
            }
            return(results);
        }
Beispiel #2
0
        public virtual LongIntComboListEnumerator[] GetEnumerators()
        {
            if (!didopen)
            {
                throw new Exception("Attempted to GetEnumerators before Open");
            }

            LongIntComboListEnumerator[] results;
            lock (dslaves)
            {
                byte enumid = nextenumid;
                if (nextenumid >= 32)
                    nextenumid = 0;
                else
                    nextenumid++;

                int i;
                results = new LongIntComboListEnumerator[dslaves.Count];

                i = 0;
                foreach (SlaveInfo _slave in dslaves)
                {
                    BufSlaveInfo slave = (BufSlaveInfo)_slave;
                    if (addbufinitsize > 0)
                    {
                        lock (slave)
                        {
                            slave.FlushAddBuf_unlocked();
                        }
                    }
                    results[i] = new LongIntComboListEnumerator(slave, enumid);
                    results[i].buf = this.buf; // Not needed, but fine.
                    i++;
                }
            }
            return results;
        }