Exemplo n.º 1
0
        internal Thread(ThreadLoopType lt, ManualResetEvent initEvent)
        {
            is_searching  = do_exit = false;
            maxPly        = splitPointsCnt = 0;
            curSplitPoint = null;
            loopType      = lt;
            idx           = Threads.size();

            do_sleep = loopType != ThreadLoopType.Main; // Avoid a race with start_searching()

            for (int j = 0; j < Constants.MAX_SPLITPOINTS_PER_THREAD; j++)
            {
                splitPoints[j] = new SplitPoint();
            }

            ThreadPool.QueueUserWorkItem(this.StartThread, initEvent);
        }
Exemplo n.º 2
0
        internal Thread(ThreadLoopType lt, ManualResetEvent initEvent)
        {
            is_searching  = do_exit = false;
            maxPly        = splitPointsCnt = 0;
            curSplitPoint = null;
            loopType      = lt;
            idx           = Threads.size();

            do_sleep = loopType != ThreadLoopType.Main; // Avoid a race with start_searching()

            for (int j = 0; j < Constants.MAX_SPLITPOINTS_PER_THREAD; j++)
            {
                splitPoints[j] = new SplitPoint();
            }

#if WINDOWS_RT
            Windows.Foundation.IAsyncAction action = Windows.System.Threading.ThreadPool.RunAsync(delegate { StartThread(initEvent); }, WorkItemPriority.Normal);
#else
            ThreadPool.QueueUserWorkItem(this.StartThread, initEvent);
#endif
        }
Exemplo n.º 3
0
        internal Thread(ThreadLoopType lt, ManualResetEvent initEvent)
        {
            is_searching = do_exit = false;
            maxPly = splitPointsCnt = 0;
            curSplitPoint = null;
            loopType = lt;
            idx = Threads.size();

            do_sleep = loopType != ThreadLoopType.Main; // Avoid a race with start_searching()

            for (int j = 0; j < Constants.MAX_SPLITPOINTS_PER_THREAD; j++)
            {
                splitPoints[j] = new SplitPoint();
            }

            ThreadPool.QueueUserWorkItem(this.StartThread, initEvent);
        }
Exemplo n.º 4
0
        internal Thread(ThreadLoopType lt, ManualResetEvent initEvent)
        {
            is_searching = do_exit = false;
            maxPly = splitPointsCnt = 0;
            curSplitPoint = null;
            loopType = lt;
            idx = Threads.size();

            do_sleep = loopType != ThreadLoopType.Main; // Avoid a race with start_searching()

            for (int j = 0; j < Constants.MAX_SPLITPOINTS_PER_THREAD; j++)
            {
                splitPoints[j] = new SplitPoint();
            }

#if WINDOWS_RT
            Windows.Foundation.IAsyncAction action = Windows.System.Threading.ThreadPool.RunAsync(delegate { StartThread(initEvent); }, WorkItemPriority.Normal);
#else
            ThreadPool.QueueUserWorkItem(this.StartThread, initEvent);
#endif
        }