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:
parent
8d6fc55065
commit
fe7084a5f0
11
src/uci.cpp
11
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
|
||||
|
|
Loading…
Reference in New Issue