X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fthread.cpp;h=80765cdeba0a981e2bbe21120e1694f355c5040c;hp=3b59a05df3e0711c7a2943c4d66ca254ca3e29f3;hb=50a7200b18e96a6f0e2c2ee7fda017ea6f2f1c1f;hpb=c67fb8ef04439dbd208bfcd53a89367372ef84e7 diff --git a/src/thread.cpp b/src/thread.cpp index 3b59a05d..80765cde 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -19,6 +19,7 @@ #include // For std::count #include +#include // For memset #include #include "movegen.h" @@ -43,7 +44,7 @@ namespace { extern "C" { // Thread c'tor starts a newly-created thread of execution that will call // the the virtual function idle_loop(), going immediately to sleep. -Thread::Thread() : splitPoints() { +Thread::Thread() /* : splitPoints() */ { // Value-initialization bug in MSVC searching = exit = false; maxPly = splitPointsSize = 0; @@ -280,6 +281,8 @@ void Thread::split(Position& pos, Stack* ss, Value alpha, Value beta, Value* bes sp.cutoff = false; sp.ss = ss; + memset(sp.slavesPositions, 0, sizeof(sp.slavesPositions)); + // Try to allocate available threads and ask them to start searching setting // 'searching' flag. This must be done under lock protection to avoid concurrent // allocation of the same slave by another master.