Ejemplo n.º 1
0
        protected void UpdateStatus()
        {
            lock (this)
            {
                SearchStatus.Nodes = NodesSearched;
                SearchStatus.Evals = NodesEvaluated;
                SearchStatus.TranspositionTableHits = TranspositionTableHits;
                SearchStatus.Status = Status;

                SearchStatusCopy = SearchStatus.Clone();
                UpdateStatusFlag = false;
                Monitor.PulseAll(this);
            }
        }
Ejemplo n.º 2
0
        public SearchStatus GetStatus()
        {
            lock (this)
            {
                UpdateStatusFlag = true;

                while ((UpdateStatusFlag) && (Status != SearchStatusType.Stopped) && (Status != SearchStatusType.Completed))
                {
                    Monitor.Wait(this, TimeSpan.FromMilliseconds(50));
                }

                return(SearchStatusCopy.Clone());
            }
        }