diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-08-15 03:07:32 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-08-15 03:07:32 +0300 |
commit | 369f52284a6443c599c15bf9d0bf2206a489452d (patch) | |
tree | dcadcfa5c31be7bb34286bf223f1919cb71b1f52 | |
parent | a6874ef87f2a219a5fd1d0533d4d0b60d474939b (diff) | |
download | chessnost-369f52284a6443c599c15bf9d0bf2206a489452d.tar.gz |
fix: resolve getting stuck before checkmate
-rw-r--r-- | src/grossmeister/UCI.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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<Self> { 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 { |