thread: uci: 解决概率性出现 data race 问题

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
This commit is contained in:
Calcitem 2020-10-28 01:02:50 +08:00
parent 8d6fc55065
commit fe7084a5f0
1 changed files with 9 additions and 2 deletions

View File

@ -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