From 369f52284a6443c599c15bf9d0bf2206a489452d Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 15 Aug 2023 03:07:32 +0300 Subject: fix: resolve getting stuck before checkmate --- src/grossmeister/UCI.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/grossmeister/UCI.rs') diff --git a/src/grossmeister/UCI.rs b/src/grossmeister/UCI.rs index e88d970..1997221 100644 --- a/src/grossmeister/UCI.rs +++ b/src/grossmeister/UCI.rs @@ -172,6 +172,9 @@ impl Grossmeister { fn create_search_thread(&self, depth: u8, duration: Duration) -> JoinHandle { let ordering = std::sync::atomic::Ordering::Relaxed; let should_halt = self.should_halt.clone(); + // Make sure we don't halt right away + should_halt.store(false, std::sync::atomic::Ordering::Relaxed); + let should_terminate = Arc::new(AtomicBool::new(true)); if duration < Duration::MAX { -- cgit v1.2.3