X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=16efe2db15cc5920fb0966bb64c4a493508bc88a;hb=3441e0075decb1acd8d3b4020b7822f743613124;hp=8adbfd92ca240b418c09598f67847c2097a745d8;hpb=b1cf1acb93532248fb10c2ca983d80389d5aeb84;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 8adbfd92..16efe2db 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); @@ -1910,9 +1906,6 @@ void Thread::idle_loop(SplitPoint* sp_master) { Threads[master].wake_up(); } } - // In helpful master concept a master can help only a sub-tree of its split - // point, and because here is all finished is not possible master is booked. - assert(!is_searching); }