Ejemplo n.º 1
0
        private void _qm_worker(object arg)
        {
            bool      done = false;
            Changeset cs   = null;

            while (!done)
            {
                bool signaled = _queries.ItemsWaiting.WaitOne(100);

                if (signaled)
                {
                    QueryRec rec = _queries.pop();

                    if (rec != null)
                    {
                        cs = _mergeHist.getCS(rec.id);

                        /* run the query. */
                        List <QueryRec> recs = _mergeHist.queryMerge(cs, rec.item, rec.distance);

                        /* dump the extra queries into the queue */
                        foreach (var r in recs)
                        {
                            _queries.push(r);
                        }
                    }
                    else
                    {
                        done = true;
                    }
                }
                else
                {
                    done = true;
                }
            }
        }