From fe7084a5f043f6c8f8fd96c3f27ea43f4f63ce0f Mon Sep 17 00:00:00 2001 From: Calcitem Date: Wed, 28 Oct 2020 01:02:50 +0800 Subject: [PATCH] =?UTF-8?q?thread:=20uci:=20=E8=A7=A3=E5=86=B3=E6=A6=82?= =?UTF-8?q?=E7=8E=87=E6=80=A7=E5=87=BA=E7=8E=B0=20data=20race=20=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ThreadSanitizer: data race /home/calcitem/Sanmill/src/thread.cpp:434:18 in Thread::adjustDepth() ThreadSanitizer: data race /home/calcitem/Sanmill/src/uci.cpp:121:28 in (anonymous namespace)::go(Position*) ThreadSanitizer: data race /home/calcitem/Sanmill/src/./position.h:285:15 in Position::key() const --- src/uci.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/uci.cpp b/src/uci.cpp index 1ba4b757..7f783f97 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -117,8 +117,15 @@ void go(Position *pos) } #endif - pos->set(StartFEN, Threads.main()); - Threads.main()->us = BLACK; // WAR + while (true) { + if (Threads.main()->searching == true) { + continue; + } + + pos->set(StartFEN, Threads.main()); + Threads.main()->us = BLACK; // WAR + break; + } #else return; #endif