X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=73050bdf12534065495807d016753debd2e8ca3b;hp=8adbfd92ca240b418c09598f67847c2097a745d8;hb=821e1c72337e435d805aa2e29743d8b79c9d65a9;hpb=b1cf1acb93532248fb10c2ca983d80389d5aeb84 diff --git a/src/search.cpp b/src/search.cpp index 8adbfd92..73050bdf 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -307,11 +307,7 @@ void Search::think() { << endl; } - for (int i = 0; i < Threads.size(); i++) - { - Threads[i].maxPly = 0; - Threads[i].wake_up(); - } + Threads.set_size(Options["Threads"]); // Set best timer interval to avoid lagging under time pressure. Timer is // used to check for remaining available thinking time. @@ -1771,14 +1767,14 @@ void RootMove::extract_pv_from_tt(Position& pos) { pos.do_move(m, *st++); while ( (tte = TT.probe(pos.key())) != NULL - && tte->move() != MOVE_NONE - && pos.is_pseudo_legal(tte->move()) - && pos.pl_move_is_legal(tte->move(), pos.pinned_pieces()) + && (m = tte->move()) != MOVE_NONE // Local copy, TT entry could change + && pos.is_pseudo_legal(m) + && pos.pl_move_is_legal(m, pos.pinned_pieces()) && ply < MAX_PLY && (!pos.is_draw() || ply < 2)) { - pv.push_back(tte->move()); - pos.do_move(tte->move(), *st++); + pv.push_back(m); + pos.do_move(m, *st++); ply++; } pv.push_back(MOVE_NONE); @@ -1869,7 +1865,7 @@ void Thread::idle_loop(SplitPoint* sp_master) { lock_grab(Threads.splitLock); assert(is_searching); - SplitPoint* sp = splitPoint; + SplitPoint* sp = curSplitPoint; lock_release(Threads.splitLock);