Exemple #1
0
        private static void SearchTask()
        {
            try
            {
                var source = new CancellationTokenSource();
                Task.Run(async() => await MaxTimeTask(source.Token), source.Token);
                Task.Run(async() => await InfoTask(source.Token), source.Token);
                _maxTimeExceeded = false;
                SearchUtil.Start(_cb);

                // calculation ready
                source.Cancel();

                UciOut.SendBestMove(_threadData);
            }
            catch (Exception e)
            {
                ErrorLogger.Log(_cb, e, true);
            }
        }