X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=cabd1cca38c02d31693bbbc5f8be3c4e00e8fa18;hp=60b7c8062a2ba118f4c33b8e369eb468dc5364a5;hb=e5bc79fb9cf0f47c850ad0cc0b057d9f86e788cd;hpb=880726c13a393e70ddc358741e68cc28a546ae8c diff --git a/src/search.cpp b/src/search.cpp index 60b7c806..cabd1cca 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1672,9 +1672,9 @@ void Thread::idle_loop() { sp->mutex.lock(); - assert(sp->slavesPositions[idx] == NULL); + assert(activePosition == NULL); - sp->slavesPositions[idx] = &pos; + activePosition = &pos; switch (sp->nodeType) { case Root: @@ -1693,7 +1693,7 @@ void Thread::idle_loop() { assert(searching); searching = false; - sp->slavesPositions[idx] = NULL; + activePosition = NULL; sp->slavesMask &= ~(1ULL << idx); sp->nodes += pos.nodes_searched(); @@ -1742,7 +1742,7 @@ void check_time() { nodes = RootPos.nodes_searched(); // Loop across all split points and sum accumulated SplitPoint nodes plus - // all the currently active slaves positions. + // all the currently active positions nodes. for (size_t i = 0; i < Threads.size(); i++) for (int j = 0; j < Threads[i]->splitPointsSize; j++) { @@ -1754,8 +1754,9 @@ void check_time() { Bitboard sm = sp.slavesMask; while (sm) { - Position* pos = sp.slavesPositions[pop_lsb(&sm)]; - nodes += pos ? pos->nodes_searched() : 0; + Position* pos = Threads[pop_lsb(&sm)]->activePosition; + if (pos) + nodes += pos->nodes_searched(); } sp.mutex.unlock();